From 9aab91516ad8e75d7cc85be0f9c79a1bf52bee0f Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 27 May 2024 16:48:42 +0800 Subject: [PATCH 01/19] Add DeploymentStacks APIs --- ...esourceManager.Resources.netstandard2.0.cs | 377 ++++++ .../Samples/Sample_ArmDeploymentCollection.cs | 2 +- .../Samples/Sample_ArmDeploymentResource.cs | 12 +- .../src/Generated/ArmDeploymentCollection.cs | 20 +- .../src/Generated/ArmDeploymentResource.cs | 64 +- .../src/Generated/ArmResourcesModelFactory.cs | 114 ++ .../Generated/DeploymentStackCollection.cs | 483 ++++++++ .../DeploymentStackData.Serialization.cs | 1090 +++++++++++++++++ .../src/Generated/DeploymentStackData.cs | 254 ++++ .../DeploymentStackResource.Serialization.cs | 26 + .../src/Generated/DeploymentStackResource.cs | 783 ++++++++++++ .../Extensions/MockableResourcesArmClient.cs | 87 ++ ...ockableResourcesManagementGroupResource.cs | 4 +- .../MockableResourcesResourceGroupResource.cs | 4 +- .../MockableResourcesSubscriptionResource.cs | 4 +- .../MockableResourcesTenantResource.cs | 8 +- .../Extensions/ResourcesExtensions.cs | 135 +- .../DeploymentStackOperationSource.cs | 38 + ...ymentStackValidateResultOperationSource.cs | 30 + .../Models/ActionOnUnmanage.Serialization.cs | 209 ++++ .../src/Generated/Models/ActionOnUnmanage.cs | 83 ++ .../Models/DenySettings.Serialization.cs | 303 +++++ .../src/Generated/Models/DenySettings.cs | 90 ++ .../src/Generated/Models/DenySettingsMode.cs | 54 + .../src/Generated/Models/DenyStatusMode.cs | 63 + .../DeploymentParameter.Serialization.cs | 230 ++++ .../Generated/Models/DeploymentParameter.cs | 105 ++ ...DeploymentStackListResult.Serialization.cs | 212 ++++ .../Models/DeploymentStackListResult.cs | 70 ++ .../DeploymentStackProvisioningState.cs | 78 ++ ...ntStackValidateProperties.Serialization.cs | 429 +++++++ .../DeploymentStackValidateProperties.cs | 103 ++ ...oymentStackValidateResult.Serialization.cs | 298 +++++ .../Models/DeploymentStackValidateResult.cs | 77 ++ ...loymentStacksDebugSetting.Serialization.cs | 163 +++ .../Models/DeploymentStacksDebugSetting.cs | 66 + .../DeploymentStacksDeleteDetachEnum.cs | 51 + ...ymentStacksParametersLink.Serialization.cs | 186 +++ .../Models/DeploymentStacksParametersLink.cs | 81 ++ ...loymentStacksTemplateLink.Serialization.cs | 301 +++++ .../Models/DeploymentStacksTemplateLink.cs | 86 ++ ...eyVaultParameterReference.Serialization.cs | 220 ++++ .../Models/KeyVaultParameterReference.cs | 102 ++ .../ManagedResourceReference.Serialization.cs | 223 ++++ .../Models/ManagedResourceReference.cs | 39 + ...rceReferenceAutoGenerated.Serialization.cs | 163 +++ .../Models/ResourceReferenceAutoGenerated.cs | 66 + ...ResourceReferenceExtended.Serialization.cs | 193 +++ .../Models/ResourceReferenceExtended.cs | 34 + .../Generated/Models/ResourceStatusMode.cs | 54 + .../UnmanageActionManagementGroupMode.cs | 51 + .../Models/UnmanageActionResourceGroupMode.cs | 51 + .../Models/UnmanageActionResourceMode.cs | 51 + .../DeploymentRestOperations.cs | 2 +- .../DeploymentStacksRestOperations.cs | 567 +++++++++ .../DeploymentsRestOperations.cs | 2 +- .../src/autorest.md | 327 ++++- 57 files changed, 8943 insertions(+), 75 deletions(-) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index e15be5aca25e6..a442c4ae5262c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -264,6 +264,79 @@ protected ArmDeploymentScriptResource() { } public virtual Azure.Response Update(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class DeploymentStackCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DeploymentStackCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DeploymentStackData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentStackData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Resources.Models.ActionOnUnmanage ActionOnUnmanage { get { throw null; } set { } } + public bool? BypassStackOutOfSyncError { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public string DebugSettingDetailLevel { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList DeletedResources { get { throw null; } } + public Azure.ResourceManager.Resources.Models.DenySettings DenySettings { get { throw null; } set { } } + public string DeploymentId { get { throw null; } } + public string DeploymentScope { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList DetachedResources { get { throw null; } } + public System.TimeSpan? Duration { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList FailedResources { get { throw null; } } + public System.BinaryData Outputs { get { throw null; } } + public System.Collections.Generic.IDictionary Parameters { get { throw null; } } + public Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink ParametersLink { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Resources { get { throw null; } } + public System.BinaryData Template { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink TemplateLink { get { throw null; } set { } } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentStackResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DeploymentStackResource() { } + public virtual Azure.ResourceManager.Resources.DeploymentStackData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode? unmanageActionResources = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode?), Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode? unmanageActionResourceGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode?), Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode? unmanageActionManagementGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode?), bool? bypassStackOutOfSyncError = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode? unmanageActionResources = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode?), Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode? unmanageActionResourceGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode?), Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode? unmanageActionManagementGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode?), bool? bypassStackOutOfSyncError = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation ValidateStack(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateStackAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class JitRequestCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected JitRequestCollection() { } @@ -358,6 +431,10 @@ public static partial class ResourcesExtensions public static Azure.ResourceManager.Resources.ArmDeploymentScriptCollection GetArmDeploymentScripts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetArmDeploymentScripts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetArmDeploymentScriptsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeploymentStack(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeploymentStackAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackResource GetDeploymentStackResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } public static Azure.Response GetJitRequest(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetJitRequestAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetJitRequestDefinitions(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -526,6 +603,10 @@ protected MockableResourcesArmClient() { } public virtual Azure.ResourceManager.Resources.ArmApplicationResource GetArmApplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentResource GetArmDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentScriptResource GetArmDeploymentScriptResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.Response GetDeploymentStack(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStackAsync(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.DeploymentStackResource GetDeploymentStackResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(Azure.Core.ResourceIdentifier scope) { throw null; } public virtual Azure.ResourceManager.Resources.JitRequestResource GetJitRequestResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ScriptLogResource GetScriptLogResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.TemplateSpecResource GetTemplateSpecResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -589,6 +670,18 @@ protected MockableResourcesTenantResource() { } } namespace Azure.ResourceManager.Resources.Models { + public partial class ActionOnUnmanage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ActionOnUnmanage(Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum resources) { } + public Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum? ManagementGroups { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum? ResourceGroups { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum Resources { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.ActionOnUnmanage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ActionOnUnmanage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ArmApplicationArtifact : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ArmApplicationArtifact() { } @@ -1120,8 +1213,13 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.BasicArmDependency BasicArmDependency(string id = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompiledFileDefinition DecompiledFileDefinition(string path = null, string contents = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult DecompileOperationSuccessResult(System.Collections.Generic.IEnumerable files = null, string entryPoint = null) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackData DeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } + public static Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult DeploymentStackValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties properties = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeploymentExtended(string provisioningState = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentType? deploymentType = default(Azure.ResourceManager.Resources.Models.ErrorDeploymentType?), string deploymentName = null) { throw null; } public static Azure.ResourceManager.Resources.JitRequestData JitRequestData(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 applicationResourceId = null, System.Guid? publisherTenantId = default(System.Guid?), System.Collections.Generic.IEnumerable jitAuthorizationPolicies = null, Azure.ResourceManager.Resources.Models.JitSchedulingPolicy jitSchedulingPolicy = null, Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), Azure.ResourceManager.Resources.Models.JitRequestState? jitRequestState = default(Azure.ResourceManager.Resources.Models.JitRequestState?), Azure.ResourceManager.Resources.Models.ArmApplicationDetails createdBy = null, Azure.ResourceManager.Resources.Models.ArmApplicationDetails updatedBy = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.ManagedResourceReference ManagedResourceReference(string id = null, Azure.ResourceManager.Resources.Models.ResourceStatusMode? status = default(Azure.ResourceManager.Resources.Models.ResourceStatusMode?), Azure.ResourceManager.Resources.Models.DenyStatusMode? denyStatus = default(Azure.ResourceManager.Resources.Models.DenyStatusMode?)) { throw null; } + public static Azure.ResourceManager.Resources.Models.ResourceReferenceAutoGenerated ResourceReferenceAutoGenerated(string id = null) { throw null; } + public static Azure.ResourceManager.Resources.Models.ResourceReferenceExtended ResourceReferenceExtended(string id = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.Resources.ScriptLogData ScriptLogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string log = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ScriptStatus ScriptStatus(string containerInstanceId = null, string storageAccountId = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.Resources.Models.StatusMessage StatusMessage(string status = null, Azure.ResponseError error = null) { throw null; } @@ -1227,6 +1325,169 @@ internal DecompileOperationSuccessResult() { } Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public partial class DenySettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DenySettings(Azure.ResourceManager.Resources.Models.DenySettingsMode mode) { } + public bool? ApplyToChildScopes { get { throw null; } set { } } + public System.Collections.Generic.IList ExcludedActions { get { throw null; } } + public System.Collections.Generic.IList ExcludedPrincipals { get { throw null; } } + public Azure.ResourceManager.Resources.Models.DenySettingsMode Mode { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.DenySettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DenySettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DenySettingsMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DenySettingsMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.DenySettingsMode DenyDelete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenySettingsMode DenyWriteAndDelete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenySettingsMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.DenySettingsMode 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.Resources.Models.DenySettingsMode left, Azure.ResourceManager.Resources.Models.DenySettingsMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.DenySettingsMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.DenySettingsMode left, Azure.ResourceManager.Resources.Models.DenySettingsMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DenyStatusMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DenyStatusMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.DenyStatusMode DenyDelete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenyStatusMode DenyWriteAndDelete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenyStatusMode Inapplicable { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenyStatusMode None { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenyStatusMode NotSupported { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DenyStatusMode RemovedBySystem { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.DenyStatusMode 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.Resources.Models.DenyStatusMode left, Azure.ResourceManager.Resources.Models.DenyStatusMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.DenyStatusMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.DenyStatusMode left, Azure.ResourceManager.Resources.Models.DenyStatusMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeploymentParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentParameter() { } + public string DeploymentParameterType { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.KeyVaultParameterReference Reference { get { throw null; } set { } } + public System.BinaryData Value { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.DeploymentParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentParameter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DeploymentStackProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DeploymentStackProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Canceling { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState DeletingResources { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Deploying { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState UpdatingDenyAssignments { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Validating { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState Waiting { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState 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.Resources.Models.DeploymentStackProvisioningState left, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState left, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DeploymentStacksDeleteDetachEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DeploymentStacksDeleteDetachEnum(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum Delete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum 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.Resources.Models.DeploymentStacksDeleteDetachEnum left, Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum left, Azure.ResourceManager.Resources.Models.DeploymentStacksDeleteDetachEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeploymentStacksParametersLink : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentStacksParametersLink(System.Uri uri) { } + public string ContentVersion { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentStacksTemplateLink : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentStacksTemplateLink() { } + public string ContentVersion { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string QueryString { get { throw null; } set { } } + public string RelativePath { get { throw null; } set { } } + public System.Uri Uri { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentStackValidateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentStackValidateProperties() { } + public Azure.ResourceManager.Resources.Models.ActionOnUnmanage ActionOnUnmanage { get { throw null; } set { } } + public string CorrelationId { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.DenySettings DenySettings { get { throw null; } set { } } + public string DeploymentScope { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Parameters { get { throw null; } } + public Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink TemplateLink { get { throw null; } set { } } + public System.Collections.Generic.IList ValidatedResources { get { throw null; } } + Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentStackValidateResult : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentStackValidateResult() { } + public Azure.ResponseError Error { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } public partial class ErrorDeployment : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1400,6 +1661,18 @@ public JitSchedulingPolicy(Azure.ResourceManager.Resources.Models.JitSchedulingT public static bool operator !=(Azure.ResourceManager.Resources.Models.JitSchedulingType left, Azure.ResourceManager.Resources.Models.JitSchedulingType right) { throw null; } public override string ToString() { throw null; } } + public partial class KeyVaultParameterReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyVaultParameterReference(Azure.ResourceManager.Resources.Models.WritableSubResource keyVault, string secretName) { } + public Azure.Core.ResourceIdentifier KeyVaultId { get { throw null; } set { } } + public string SecretName { get { throw null; } set { } } + public string SecretVersion { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.KeyVaultParameterReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.KeyVaultParameterReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class LinkedTemplateArtifact : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LinkedTemplateArtifact(string path, System.BinaryData template) { } @@ -1411,6 +1684,17 @@ public LinkedTemplateArtifact(string path, System.BinaryData template) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ManagedResourceReference : Azure.ResourceManager.Resources.Models.ResourceReferenceAutoGenerated, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedResourceReference() { } + public Azure.ResourceManager.Resources.Models.DenyStatusMode? DenyStatus { get { throw null; } set { } } + public Azure.ResourceManager.Resources.Models.ResourceStatusMode? Status { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.ManagedResourceReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ManagedResourceReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public enum ProvisioningOperationKind { NotSpecified = 0, @@ -1424,6 +1708,26 @@ public enum ProvisioningOperationKind EvaluateDeploymentOutput = 8, DeploymentCleanup = 9, } + public partial class ResourceReferenceAutoGenerated : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceReferenceAutoGenerated() { } + public string Id { get { throw null; } } + Azure.ResourceManager.Resources.Models.ResourceReferenceAutoGenerated System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ResourceReferenceAutoGenerated System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ResourceReferenceExtended : Azure.ResourceManager.Resources.Models.ResourceReferenceAutoGenerated, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceReferenceExtended() { } + public Azure.ResponseError Error { get { throw null; } set { } } + Azure.ResourceManager.Resources.Models.ResourceReferenceExtended System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.ResourceReferenceExtended System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ResourcesProvisioningState : System.IEquatable { @@ -1453,6 +1757,25 @@ public enum ProvisioningOperationKind public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceStatusMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceStatusMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.ResourceStatusMode DeleteFailed { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.ResourceStatusMode Managed { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.ResourceStatusMode RemoveDenyFailed { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.ResourceStatusMode 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.Resources.Models.ResourceStatusMode left, Azure.ResourceManager.Resources.Models.ResourceStatusMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.ResourceStatusMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.ResourceStatusMode left, Azure.ResourceManager.Resources.Models.ResourceStatusMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ScriptCleanupOptions : System.IEquatable { private readonly object _dummy; @@ -1616,6 +1939,60 @@ public TemplateSpecVersionPatch() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UnmanageActionManagementGroupMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UnmanageActionManagementGroupMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode Delete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode 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.Resources.Models.UnmanageActionManagementGroupMode left, Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode left, Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UnmanageActionResourceGroupMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UnmanageActionResourceGroupMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode Delete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode 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.Resources.Models.UnmanageActionResourceGroupMode left, Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode left, Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UnmanageActionResourceMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UnmanageActionResourceMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode Delete { get { throw null; } } + public static Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode 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.Resources.Models.UnmanageActionResourceMode left, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode left, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class WhatIfChange : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal WhatIfChange() { } diff --git a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs index ce51954e5df6c..7825e52a8fa33 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ArmDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateDeploymentAtAGivenScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PutDeploymentAtScope.json // this example is just showing the usage of "Deployments_CreateOrUpdateAtScope" 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/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs index f31af4caffde5..c98a85fb53476 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/samples/Generated/Samples/Sample_ArmDeploymentResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ArmDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateDeploymentAtAGivenScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PutDeploymentAtScope.json // this example is just showing the usage of "Deployments_CreateOrUpdateAtScope" 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 @@ -70,7 +70,7 @@ public async Task Update_CreateDeploymentAtAGivenScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnTenant.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnTenant.json // this example is just showing the usage of "Deployments_WhatIfAtTenantScope" 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 @@ -110,7 +110,7 @@ public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope1() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnManagementGroup.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnManagementGroup.json // this example is just showing the usage of "Deployments_WhatIfAtManagementGroupScope" 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 @@ -151,7 +151,7 @@ public async Task WhatIf_PredictTemplateChangesAtManagementGroupScope1() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task WhatIf_PredictTemplateChangesAtSubscriptionScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnSubscription.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnSubscription.json // this example is just showing the usage of "Deployments_WhatIfAtSubscriptionScope" 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 @@ -192,7 +192,7 @@ public async Task WhatIf_PredictTemplateChangesAtSubscriptionScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task WhatIf_PredictTemplateChangesAtResourceGroupScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnResourceGroup.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/PostDeploymentWhatIfOnResourceGroup.json // this example is just showing the usage of "Deployments_WhatIf" 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 @@ -231,7 +231,7 @@ public async Task WhatIf_PredictTemplateChangesAtResourceGroupScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CalculateDeploymentTemplateHash_CalculateTemplateHash() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/CalculateTemplateHash.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/examples/CalculateTemplateHash.json // this example is just showing the usage of "Deployments_CalculateTemplateHash" 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/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs index 6ba954164fc38..a52edf8589293 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentCollection.cs @@ -56,7 +56,7 @@ internal ArmDeploymentCollection(ArmClient client, ResourceIdentifier id) : base /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -199,7 +199,7 @@ public virtual async Task> GetAsync(string deplo /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -244,7 +244,7 @@ public virtual Response Get(string deploymentName, Cancel /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual AsyncPageable GetAllAsync(string filter = /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual Pageable GetAll(string filter = null, int? /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -351,7 +351,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -394,7 +394,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -439,7 +439,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs index 93954d0884de5..d9a707ff1fd5f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentResource.cs @@ -107,7 +107,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -147,7 +147,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -187,7 +187,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, A /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task CancelAsync(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -439,7 +439,7 @@ public virtual Response Cancel(CancellationToken cancellationToken = default) /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual async Task> ValidateAsy /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -531,7 +531,7 @@ public virtual ArmOperation Validate(WaitUntil wait /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -569,7 +569,7 @@ public virtual async Task> ExportTemplateAsy /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -607,7 +607,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -623,7 +623,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -655,7 +655,7 @@ public virtual Response ExportTemplate(CancellationTo /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -732,7 +732,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -748,7 +748,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -764,7 +764,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -780,7 +780,7 @@ public virtual async Task> WhatIfAsync(WaitU /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -857,7 +857,7 @@ public virtual ArmOperation WhatIf(WaitUntil waitUntil, A /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// @@ -896,7 +896,7 @@ public virtual async Task> GetDeploymentOperati /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// @@ -935,7 +935,7 @@ public virtual Response GetDeploymentOperation(string op /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// @@ -962,7 +962,7 @@ public virtual AsyncPageable GetDeploymentOperationsAsyn /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// @@ -989,7 +989,7 @@ public virtual Pageable GetDeploymentOperations(int? top /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1027,7 +1027,7 @@ public virtual async Task CheckExistenceAsync(CancellationToken cancel /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1065,7 +1065,7 @@ public virtual Response CheckExistence(CancellationToken cancellationToken = def /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1127,7 +1127,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1189,7 +1189,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1246,7 +1246,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1303,7 +1303,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1363,7 +1363,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index c65c277dbfe9a..97451739f2bff 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -849,6 +849,120 @@ public static DecompiledFileDefinition DecompiledFileDefinition(string path = nu { return new DecompiledFileDefinition(path, contents, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The error detail. + /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// The URI of the template. Use either the templateLink property or the template property, but not both. + /// Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. + /// The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. + /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. + /// The debug setting of the deployment. + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + /// The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + /// Deployment stack description. Max length of 4096 characters. + /// Defines how resources deployed by the stack are locked. + /// State of the deployment stack. + /// The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. + /// An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. + /// An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. + /// An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. + /// An array of resources currently managed by the deployment stack. + /// The resourceId of the deployment resource created by the deployment stack. + /// The outputs of the deployment resource created by the deployment stack. + /// The duration of the last successful Deployment stack update. + /// A new instance for mocking. + public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + { + tags ??= new Dictionary(); + parameters ??= new Dictionary(); + detachedResources ??= new List(); + deletedResources ??= new List(); + failedResources ??= new List(); + resources ??= new List(); + + return new DeploymentStackData( + id, + name, + resourceType, + systemData, + tags, + location, + error, + template, + templateLink, + parameters, + parametersLink, + actionOnUnmanage, + debugSettingDetailLevel != null ? new DeploymentStacksDebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, + bypassStackOutOfSyncError, + deploymentScope, + description, + denySettings, + provisioningState, + correlationId, + detachedResources?.ToList(), + deletedResources?.ToList(), + failedResources?.ToList(), + resources?.ToList(), + deploymentId, + outputs, + duration, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resourceId of a resource managed by the deployment stack. + /// A new instance for mocking. + public static ResourceReferenceAutoGenerated ResourceReferenceAutoGenerated(string id = null) + { + return new ResourceReferenceAutoGenerated(id, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resourceId of a resource managed by the deployment stack. + /// The error detail. + /// A new instance for mocking. + public static ResourceReferenceExtended ResourceReferenceExtended(string id = null, ResponseError error = null) + { + return new ResourceReferenceExtended(id, serializedAdditionalRawData: null, error); + } + + /// Initializes a new instance of . + /// The resourceId of a resource managed by the deployment stack. + /// Current management state of the resource in the deployment stack. + /// denyAssignment settings applied to the resource. + /// A new instance for mocking. + public static ManagedResourceReference ManagedResourceReference(string id = null, ResourceStatusMode? status = null, DenyStatusMode? denyStatus = null) + { + return new ManagedResourceReference(id, serializedAdditionalRawData: null, status, denyStatus); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The validation result details. + /// The error detail. + /// A new instance for mocking. + public static DeploymentStackValidateResult DeploymentStackValidateResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeploymentStackValidateProperties properties = null, ResponseError error = null) + { + return new DeploymentStackValidateResult( + id, + name, + resourceType, + systemData, + properties, + error, + serializedAdditionalRawData: null); + } /// Initializes a new instance of . /// The id. diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs new file mode 100644 index 0000000000000..327e7aaf58780 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Resources +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDeploymentStacks method from an instance of . + /// + public partial class DeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _deploymentStackClientDiagnostics; + private readonly DeploymentStacksRestOperations _deploymentStackRestClient; + + /// Initializes a new instance of the class for mocking. + protected DeploymentStackCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", DeploymentStackResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeploymentStackResource.ResourceType, out string deploymentStackApiVersion); + _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); + } + + /// + /// Creates or updates a Deployment stack at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_CreateOrUpdateAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the deployment stack. + /// Deployment stack supplied to the operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Deployment stack at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_CreateOrUpdateAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the deployment stack. + /// Deployment stack supplied to the operation. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the Deployment stacks within the specified scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks + /// + /// + /// Operation Id + /// DeploymentStacks_ListAtCope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtCopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the Deployment stacks within the specified scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks + /// + /// + /// Operation Id + /// DeploymentStacks_ListAtCope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtCopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs new file mode 100644 index 0000000000000..cf940624caec7 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs @@ -0,0 +1,1090 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + public partial class DeploymentStackData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (Optional.IsDefined(Template)) + { + writer.WritePropertyName("template"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Template); +#else + using (JsonDocument document = JsonDocument.Parse(Template)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(TemplateLink)) + { + writer.WritePropertyName("templateLink"u8); + writer.WriteObjectValue(TemplateLink, options); + } + if (Optional.IsCollectionDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteStartObject(); + foreach (var item in Parameters) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(ParametersLink)) + { + writer.WritePropertyName("parametersLink"u8); + writer.WriteObjectValue(ParametersLink, options); + } + if (Optional.IsDefined(ActionOnUnmanage)) + { + writer.WritePropertyName("actionOnUnmanage"u8); + writer.WriteObjectValue(ActionOnUnmanage, options); + } + if (Optional.IsDefined(DebugSetting)) + { + writer.WritePropertyName("debugSetting"u8); + writer.WriteObjectValue(DebugSetting, options); + } + if (Optional.IsDefined(BypassStackOutOfSyncError)) + { + writer.WritePropertyName("bypassStackOutOfSyncError"u8); + writer.WriteBooleanValue(BypassStackOutOfSyncError.Value); + } + if (Optional.IsDefined(DeploymentScope)) + { + writer.WritePropertyName("deploymentScope"u8); + writer.WriteStringValue(DeploymentScope); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(DenySettings)) + { + writer.WritePropertyName("denySettings"u8); + writer.WriteObjectValue(DenySettings, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DetachedResources)) + { + writer.WritePropertyName("detachedResources"u8); + writer.WriteStartArray(); + foreach (var item in DetachedResources) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DeletedResources)) + { + writer.WritePropertyName("deletedResources"u8); + writer.WriteStartArray(); + foreach (var item in DeletedResources) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(FailedResources)) + { + writer.WritePropertyName("failedResources"u8); + writer.WriteStartArray(); + foreach (var item in FailedResources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteStartArray(); + foreach (var item in Resources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(DeploymentId)) + { + writer.WritePropertyName("deploymentId"u8); + writer.WriteStringValue(DeploymentId); + } + if (options.Format != "W" && Optional.IsDefined(Outputs)) + { + writer.WritePropertyName("outputs"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Outputs); +#else + using (JsonDocument document = JsonDocument.Parse(Outputs)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration.Value, "P"); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStackData(document.RootElement, options); + } + + internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ResponseError error = default; + BinaryData template = default; + DeploymentStacksTemplateLink templateLink = default; + IDictionary parameters = default; + DeploymentStacksParametersLink parametersLink = default; + ActionOnUnmanage actionOnUnmanage = default; + DeploymentStacksDebugSetting debugSetting = default; + bool? bypassStackOutOfSyncError = default; + string deploymentScope = default; + string description = default; + DenySettings denySettings = default; + DeploymentStackProvisioningState? provisioningState = default; + string correlationId = default; + IReadOnlyList detachedResources = default; + IReadOnlyList deletedResources = default; + IReadOnlyList failedResources = default; + IReadOnlyList resources = default; + string deploymentId = default; + BinaryData outputs = default; + TimeSpan? duration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + 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()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("error"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("template"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + template = BinaryData.FromString(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("templateLink"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property0.Value, options); + continue; + } + if (property0.NameEquals("parameters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, DeploymentParameter.DeserializeDeploymentParameter(property1.Value, options)); + } + parameters = dictionary; + continue; + } + if (property0.NameEquals("parametersLink"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parametersLink = DeploymentStacksParametersLink.DeserializeDeploymentStacksParametersLink(property0.Value, options); + continue; + } + if (property0.NameEquals("actionOnUnmanage"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actionOnUnmanage = ActionOnUnmanage.DeserializeActionOnUnmanage(property0.Value, options); + continue; + } + if (property0.NameEquals("debugSetting"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + debugSetting = DeploymentStacksDebugSetting.DeserializeDeploymentStacksDebugSetting(property0.Value, options); + continue; + } + if (property0.NameEquals("bypassStackOutOfSyncError"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bypassStackOutOfSyncError = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("deploymentScope"u8)) + { + deploymentScope = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("denySettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denySettings = DenySettings.DeserializeDenySettings(property0.Value, options); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DeploymentStackProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("correlationId"u8)) + { + correlationId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("detachedResources"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + detachedResources = array; + continue; + } + if (property0.NameEquals("deletedResources"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + deletedResources = array; + continue; + } + if (property0.NameEquals("failedResources"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ResourceReferenceExtended.DeserializeResourceReferenceExtended(item, options)); + } + failedResources = array; + continue; + } + if (property0.NameEquals("resources"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ManagedResourceReference.DeserializeManagedResourceReference(item, options)); + } + resources = array; + continue; + } + if (property0.NameEquals("deploymentId"u8)) + { + deploymentId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("outputs"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outputs = BinaryData.FromString(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("duration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + duration = property0.Value.GetTimeSpan("P"); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStackData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + error, + template, + templateLink, + parameters ?? new ChangeTrackingDictionary(), + parametersLink, + actionOnUnmanage, + debugSetting, + bypassStackOutOfSyncError, + deploymentScope, + description, + denySettings, + provisioningState, + correlationId, + detachedResources ?? new ChangeTrackingList(), + deletedResources ?? new ChangeTrackingList(), + failedResources ?? new ChangeTrackingList(), + resources ?? new ChangeTrackingList(), + deploymentId, + outputs, + duration, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 4, false, " error: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Template), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" template: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Template)) + { + builder.Append(" template: "); + builder.AppendLine($"'{Template.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TemplateLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" templateLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TemplateLink)) + { + builder.Append(" templateLink: "); + BicepSerializationHelpers.AppendChildObject(builder, TemplateLink, options, 4, false, " templateLink: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Parameters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" parameters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Parameters)) + { + if (Parameters.Any()) + { + builder.Append(" parameters: "); + builder.AppendLine("{"); + foreach (var item in Parameters) + { + builder.Append($" '{item.Key}': "); + BicepSerializationHelpers.AppendChildObject(builder, item.Value, options, 6, false, " parameters: "); + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ParametersLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" parametersLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ParametersLink)) + { + builder.Append(" parametersLink: "); + BicepSerializationHelpers.AppendChildObject(builder, ParametersLink, options, 4, false, " parametersLink: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ActionOnUnmanage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" actionOnUnmanage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ActionOnUnmanage)) + { + builder.Append(" actionOnUnmanage: "); + BicepSerializationHelpers.AppendChildObject(builder, ActionOnUnmanage, options, 4, false, " actionOnUnmanage: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DebugSettingDetailLevel", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" debugSetting: "); + builder.AppendLine("{"); + builder.AppendLine(" debugSetting: {"); + builder.Append(" detailLevel: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DebugSetting)) + { + builder.Append(" debugSetting: "); + BicepSerializationHelpers.AppendChildObject(builder, DebugSetting, options, 4, false, " debugSetting: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BypassStackOutOfSyncError), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" bypassStackOutOfSyncError: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BypassStackOutOfSyncError)) + { + builder.Append(" bypassStackOutOfSyncError: "); + var boolValue = BypassStackOutOfSyncError.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentScope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentScope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentScope)) + { + builder.Append(" deploymentScope: "); + if (DeploymentScope.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentScope}'''"); + } + else + { + builder.AppendLine($"'{DeploymentScope}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DenySettings), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" denySettings: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DenySettings)) + { + builder.Append(" denySettings: "); + BicepSerializationHelpers.AppendChildObject(builder, DenySettings, options, 4, false, " denySettings: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CorrelationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" correlationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CorrelationId)) + { + builder.Append(" correlationId: "); + if (CorrelationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CorrelationId}'''"); + } + else + { + builder.AppendLine($"'{CorrelationId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DetachedResources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" detachedResources: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DetachedResources)) + { + if (DetachedResources.Any()) + { + builder.Append(" detachedResources: "); + builder.AppendLine("["); + foreach (var item in DetachedResources) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " detachedResources: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeletedResources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deletedResources: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DeletedResources)) + { + if (DeletedResources.Any()) + { + builder.Append(" deletedResources: "); + builder.AppendLine("["); + foreach (var item in DeletedResources) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " deletedResources: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FailedResources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" failedResources: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(FailedResources)) + { + if (FailedResources.Any()) + { + builder.Append(" failedResources: "); + builder.AppendLine("["); + foreach (var item in FailedResources) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " failedResources: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resources: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Resources)) + { + if (Resources.Any()) + { + builder.Append(" resources: "); + builder.AppendLine("["); + foreach (var item in Resources) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " resources: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentId)) + { + builder.Append(" deploymentId: "); + if (DeploymentId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentId}'''"); + } + else + { + builder.AppendLine($"'{DeploymentId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Outputs), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" outputs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Outputs)) + { + builder.Append(" outputs: "); + builder.AppendLine($"'{Outputs.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" duration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Duration)) + { + builder.Append(" duration: "); + var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); + builder.AppendLine($"'{formattedTimeSpan}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStackData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs new file mode 100644 index 0000000000000..732dcb34ef98c --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + /// + /// A class representing the DeploymentStack data model. + /// Deployment stack object. + /// + public partial class DeploymentStackData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public DeploymentStackData(AzureLocation location) : base(location) + { + Parameters = new ChangeTrackingDictionary(); + DetachedResources = new ChangeTrackingList(); + DeletedResources = new ChangeTrackingList(); + FailedResources = new ChangeTrackingList(); + Resources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The error detail. + /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// The URI of the template. Use either the templateLink property or the template property, but not both. + /// Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. + /// The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. + /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. + /// The debug setting of the deployment. + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + /// The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + /// Deployment stack description. Max length of 4096 characters. + /// Defines how resources deployed by the stack are locked. + /// State of the deployment stack. + /// The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. + /// An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. + /// An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. + /// An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. + /// An array of resources currently managed by the deployment stack. + /// The resourceId of the deployment resource created by the deployment stack. + /// The outputs of the deployment resource created by the deployment stack. + /// The duration of the last successful Deployment stack update. + /// Keeps track of any properties unknown to the library. + internal DeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Error = error; + Template = template; + TemplateLink = templateLink; + Parameters = parameters; + ParametersLink = parametersLink; + ActionOnUnmanage = actionOnUnmanage; + DebugSetting = debugSetting; + BypassStackOutOfSyncError = bypassStackOutOfSyncError; + DeploymentScope = deploymentScope; + Description = description; + DenySettings = denySettings; + ProvisioningState = provisioningState; + CorrelationId = correlationId; + DetachedResources = detachedResources; + DeletedResources = deletedResources; + FailedResources = failedResources; + Resources = resources; + DeploymentId = deploymentId; + Outputs = outputs; + Duration = duration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentStackData() + { + } + + /// The error detail. + [WirePath("properties.error")] + public ResponseError Error { get; set; } + /// + /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("properties.template")] + public BinaryData Template { get; set; } + /// The URI of the template. Use either the templateLink property or the template property, but not both. + [WirePath("properties.templateLink")] + public DeploymentStacksTemplateLink TemplateLink { get; set; } + /// Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. + [WirePath("properties.parameters")] + public IDictionary Parameters { get; } + /// The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. + [WirePath("properties.parametersLink")] + public DeploymentStacksParametersLink ParametersLink { get; set; } + /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. + [WirePath("properties.actionOnUnmanage")] + public ActionOnUnmanage ActionOnUnmanage { get; set; } + /// The debug setting of the deployment. + internal DeploymentStacksDebugSetting DebugSetting { get; set; } + /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. + [WirePath("properties.debugSetting.detailLevel")] + public string DebugSettingDetailLevel + { + get => DebugSetting is null ? default : DebugSetting.DetailLevel; + set + { + if (DebugSetting is null) + DebugSetting = new DeploymentStacksDebugSetting(); + DebugSetting.DetailLevel = value; + } + } + + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + [WirePath("properties.bypassStackOutOfSyncError")] + public bool? BypassStackOutOfSyncError { get; set; } + /// The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). + [WirePath("properties.deploymentScope")] + public string DeploymentScope { get; set; } + /// Deployment stack description. Max length of 4096 characters. + [WirePath("properties.description")] + public string Description { get; set; } + /// Defines how resources deployed by the stack are locked. + [WirePath("properties.denySettings")] + public DenySettings DenySettings { get; set; } + /// State of the deployment stack. + [WirePath("properties.provisioningState")] + public DeploymentStackProvisioningState? ProvisioningState { get; } + /// The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. + [WirePath("properties.correlationId")] + public string CorrelationId { get; } + /// An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. + [WirePath("properties.detachedResources")] + public IReadOnlyList DetachedResources { get; } + /// An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. + [WirePath("properties.deletedResources")] + public IReadOnlyList DeletedResources { get; } + /// An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. + [WirePath("properties.failedResources")] + public IReadOnlyList FailedResources { get; } + /// An array of resources currently managed by the deployment stack. + [WirePath("properties.resources")] + public IReadOnlyList Resources { get; } + /// The resourceId of the deployment resource created by the deployment stack. + [WirePath("properties.deploymentId")] + public string DeploymentId { get; } + /// + /// The outputs of the deployment resource created by the deployment stack. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("properties.outputs")] + public BinaryData Outputs { get; } + /// The duration of the last successful Deployment stack update. + [WirePath("properties.duration")] + public TimeSpan? Duration { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs new file mode 100644 index 0000000000000..fcb29ed47817c --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Resources +{ + public partial class DeploymentStackResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs new file mode 100644 index 0000000000000..90f0580ab54ed --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs @@ -0,0 +1,783 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + /// + /// A Class representing a DeploymentStack along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeploymentStackResource method. + /// Otherwise you can get one from its parent resource using the GetDeploymentStack method. + /// + public partial class DeploymentStackResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The scope. + /// The deploymentStackName. + public static ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) + { + var resourceId = $"{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _deploymentStackClientDiagnostics; + private readonly DeploymentStacksRestOperations _deploymentStackRestClient; + private readonly DeploymentStackData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Resources/deploymentStacks"; + + /// Initializes a new instance of the class for mocking. + protected DeploymentStackResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DeploymentStackResource(ArmClient client, DeploymentStackData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deploymentStackApiVersion); + _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DeploymentStackData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Deployment stack by name at specific scope. When operation completes, status code 200 returned without content. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_DeleteAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Flag to indicate delete rather than detach for unmanaged resources. + /// Flag to indicate delete rather than detach for unmanaged resource groups. + /// Flag to indicate delete rather than detach for unmanaged management groups. + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) + { + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Deployment stack by name at specific scope. When operation completes, status code 200 returned without content. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_DeleteAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Flag to indicate delete rather than detach for unmanaged resources. + /// Flag to indicate delete rather than detach for unmanaged resource groups. + /// Flag to indicate delete rather than detach for unmanaged management groups. + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) + { + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); + var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Deployment stack at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_CreateOrUpdateAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Deployment stack supplied to the operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Deployment stack at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_CreateOrUpdateAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Deployment stack supplied to the operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate + /// + /// + /// Operation Id + /// DeploymentStacks_ValidateStackAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Deployment stack to validate. + /// The cancellation token to use. + /// is null. + public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); + scope.Start(); + try + { + var response = await _deploymentStackRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate + /// + /// + /// Operation Id + /// DeploymentStacks_ValidateStackAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Deployment stack to validate. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ValidateStack(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); + scope.Start(); + try + { + var response = _deploymentStackRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags[key] = value; + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.Remove(key); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs index 64ac6a54cd25d..b9f0ee8fd5acc 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs @@ -5,6 +5,9 @@ #nullable disable +using System; +using System.Threading; +using System.Threading.Tasks; using Azure.Core; namespace Azure.ResourceManager.Resources.Mocking @@ -34,6 +37,78 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of DeploymentStackResources in the ArmClient. + /// The scope that the resource will apply against. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks(ResourceIdentifier scope) + { + return new DeploymentStackCollection(Client, scope); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDeploymentStackAsync(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + return await GetDeploymentStacks(scope).GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The scope that the resource will apply against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDeploymentStack(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + return GetDeploymentStacks(scope).Get(deploymentStackName, cancellationToken); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -129,5 +204,17 @@ public virtual JitRequestResource GetJitRequestResource(ResourceIdentifier id) JitRequestResource.ValidateResourceId(id); return new JitRequestResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DeploymentStackResource GetDeploymentStackResource(ResourceIdentifier id) + { + DeploymentStackResource.ValidateResourceId(id); + return new DeploymentStackResource(Client, id); + } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs index 2443bf69f6829..9484d8bd1c895 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs @@ -53,7 +53,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs index e181c9315fa90..f196aa9a01c72 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs @@ -194,7 +194,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs index 0de7283b20b69..6e52cd36431c3 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs @@ -78,7 +78,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs index f85a4cc5e69ac..e2d6772f74f5e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesTenantResource.cs @@ -61,7 +61,7 @@ public virtual ArmDeploymentCollection GetArmDeployments() /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -92,7 +92,7 @@ public virtual async Task> GetArmDeploymentAsync /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -123,7 +123,7 @@ public virtual Response GetArmDeployment(string deploymen /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual async Task> CalculateDeploymentTempl /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index 70f2b84a07ffa..d2c0dfd1de266 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -43,6 +43,102 @@ private static MockableResourcesTenantResource GetMockableResourcesTenantResourc return resource.GetCachedClient(client => new MockableResourcesTenantResource(client, resource.Id)); } + /// + /// Gets a collection of DeploymentStackResources in the ArmClient. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// is null. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this ArmClient client, ResourceIdentifier scope) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableResourcesArmClient(client).GetDeploymentStacks(scope); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDeploymentStackAsync(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return await GetMockableResourcesArmClient(client).GetDeploymentStackAsync(scope, deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The scope that the resource will apply against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDeploymentStack(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableResourcesArmClient(client).GetDeploymentStack(scope, deploymentStackName, cancellationToken); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -195,6 +291,25 @@ public static JitRequestResource GetJitRequestResource(this ArmClient client, Re return GetMockableResourcesArmClient(client).GetJitRequestResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DeploymentStackResource GetDeploymentStackResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableResourcesArmClient(client).GetDeploymentStackResource(id); + } + /// /// Gets a collection of ArmDeploymentResources in the ManagementGroupResource. /// @@ -225,7 +340,7 @@ public static ArmDeploymentCollection GetArmDeployments(this ManagementGroupReso /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -263,7 +378,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -506,7 +621,7 @@ public static ArmDeploymentCollection GetArmDeployments(this ResourceGroupResour /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -544,7 +659,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -878,7 +993,7 @@ public static ArmDeploymentCollection GetArmDeployments(this SubscriptionResourc /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -916,7 +1031,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1325,7 +1440,7 @@ public static ArmDeploymentCollection GetArmDeployments(this TenantResource tena /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1363,7 +1478,7 @@ public static async Task> GetArmDeploymentAsync( /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1401,7 +1516,7 @@ public static Response GetArmDeployment(this TenantResour /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource @@ -1437,7 +1552,7 @@ public static async Task> CalculateDeploymentTempla /// /// /// Default Api Version - /// 2022-09-01 + /// 2024-03-01 /// /// /// Resource diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs new file mode 100644 index 0000000000000..24d61a2df9aa0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Resources +{ + internal class DeploymentStackOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DeploymentStackOperationSource(ArmClient client) + { + _client = client; + } + + DeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return new DeploymentStackResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return new DeploymentStackResource(_client, data); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs new file mode 100644 index 0000000000000..fbbceab1542f4 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + internal class DeploymentStackValidateResultOperationSource : IOperationSource + { + DeploymentStackValidateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return DeploymentStackValidateResult.DeserializeDeploymentStackValidateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return DeploymentStackValidateResult.DeserializeDeploymentStackValidateResult(document.RootElement); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs new file mode 100644 index 0000000000000..fd97fd37c2ff5 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class ActionOnUnmanage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionOnUnmanage)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("resources"u8); + writer.WriteStringValue(Resources.ToString()); + if (Optional.IsDefined(ResourceGroups)) + { + writer.WritePropertyName("resourceGroups"u8); + writer.WriteStringValue(ResourceGroups.Value.ToString()); + } + if (Optional.IsDefined(ManagementGroups)) + { + writer.WritePropertyName("managementGroups"u8); + writer.WriteStringValue(ManagementGroups.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ActionOnUnmanage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActionOnUnmanage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActionOnUnmanage(document.RootElement, options); + } + + internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeploymentStacksDeleteDetachEnum resources = default; + DeploymentStacksDeleteDetachEnum? resourceGroups = default; + DeploymentStacksDeleteDetachEnum? managementGroups = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resources"u8)) + { + resources = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceGroups = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("managementGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managementGroups = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActionOnUnmanage(resources, resourceGroups, managementGroups, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Resources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resources: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" resources: "); + builder.AppendLine($"'{Resources.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceGroups), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceGroups: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceGroups)) + { + builder.Append(" resourceGroups: "); + builder.AppendLine($"'{ResourceGroups.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagementGroups), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" managementGroups: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ManagementGroups)) + { + builder.Append(" managementGroups: "); + builder.AppendLine($"'{ManagementGroups.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ActionOnUnmanage)} does not support writing '{options.Format}' format."); + } + } + + ActionOnUnmanage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActionOnUnmanage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActionOnUnmanage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs new file mode 100644 index 0000000000000..e5bfff9878bd2 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Defines the behavior of resources that are no longer managed after the stack is updated or deleted. + public partial class ActionOnUnmanage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + public ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources) + { + Resources = resources; + } + + /// Initializes a new instance of . + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + /// Keeps track of any properties unknown to the library. + internal ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources, DeploymentStacksDeleteDetachEnum? resourceGroups, DeploymentStacksDeleteDetachEnum? managementGroups, IDictionary serializedAdditionalRawData) + { + Resources = resources; + ResourceGroups = resourceGroups; + ManagementGroups = managementGroups; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActionOnUnmanage() + { + } + + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + [WirePath("resources")] + public DeploymentStacksDeleteDetachEnum Resources { get; set; } + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + [WirePath("resourceGroups")] + public DeploymentStacksDeleteDetachEnum? ResourceGroups { get; set; } + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + [WirePath("managementGroups")] + public DeploymentStacksDeleteDetachEnum? ManagementGroups { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.Serialization.cs new file mode 100644 index 0000000000000..5c3e2c64f4eec --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.Serialization.cs @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DenySettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DenySettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.ToString()); + if (Optional.IsCollectionDefined(ExcludedPrincipals)) + { + writer.WritePropertyName("excludedPrincipals"u8); + writer.WriteStartArray(); + foreach (var item in ExcludedPrincipals) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ExcludedActions)) + { + writer.WritePropertyName("excludedActions"u8); + writer.WriteStartArray(); + foreach (var item in ExcludedActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ApplyToChildScopes)) + { + writer.WritePropertyName("applyToChildScopes"u8); + writer.WriteBooleanValue(ApplyToChildScopes.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DenySettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DenySettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDenySettings(document.RootElement, options); + } + + internal static DenySettings DeserializeDenySettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DenySettingsMode mode = default; + IList excludedPrincipals = default; + IList excludedActions = default; + bool? applyToChildScopes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + mode = new DenySettingsMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("excludedPrincipals"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludedPrincipals = array; + continue; + } + if (property.NameEquals("excludedActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludedActions = array; + continue; + } + if (property.NameEquals("applyToChildScopes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applyToChildScopes = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DenySettings(mode, excludedPrincipals ?? new ChangeTrackingList(), excludedActions ?? new ChangeTrackingList(), applyToChildScopes, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" mode: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" mode: "); + builder.AppendLine($"'{Mode.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExcludedPrincipals), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" excludedPrincipals: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ExcludedPrincipals)) + { + if (ExcludedPrincipals.Any()) + { + builder.Append(" excludedPrincipals: "); + builder.AppendLine("["); + foreach (var item in ExcludedPrincipals) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExcludedActions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" excludedActions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ExcludedActions)) + { + if (ExcludedActions.Any()) + { + builder.Append(" excludedActions: "); + builder.AppendLine("["); + foreach (var item in ExcludedActions) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ApplyToChildScopes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" applyToChildScopes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ApplyToChildScopes)) + { + builder.Append(" applyToChildScopes: "); + var boolValue = ApplyToChildScopes.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DenySettings)} does not support writing '{options.Format}' format."); + } + } + + DenySettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDenySettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DenySettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.cs new file mode 100644 index 0000000000000..e55173d84192c --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettings.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Defines how resources deployed by the Deployment stack are locked. + public partial class DenySettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// denySettings Mode that defines denied actions. + public DenySettings(DenySettingsMode mode) + { + Mode = mode; + ExcludedPrincipals = new ChangeTrackingList(); + ExcludedActions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// denySettings Mode that defines denied actions. + /// List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted. + /// List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted. If the denySetting mode is set to 'denyWriteAndDelete', then the following actions are automatically appended to 'excludedActions': '*\/read' and 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to 'denyDelete', then the following actions are automatically appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate actions will be removed. + /// DenySettings will be applied to child resource scopes of every managed resource with a deny assignment. + /// Keeps track of any properties unknown to the library. + internal DenySettings(DenySettingsMode mode, IList excludedPrincipals, IList excludedActions, bool? applyToChildScopes, IDictionary serializedAdditionalRawData) + { + Mode = mode; + ExcludedPrincipals = excludedPrincipals; + ExcludedActions = excludedActions; + ApplyToChildScopes = applyToChildScopes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DenySettings() + { + } + + /// denySettings Mode that defines denied actions. + [WirePath("mode")] + public DenySettingsMode Mode { get; set; } + /// List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted. + [WirePath("excludedPrincipals")] + public IList ExcludedPrincipals { get; } + /// List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted. If the denySetting mode is set to 'denyWriteAndDelete', then the following actions are automatically appended to 'excludedActions': '*\/read' and 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to 'denyDelete', then the following actions are automatically appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate actions will be removed. + [WirePath("excludedActions")] + public IList ExcludedActions { get; } + /// DenySettings will be applied to child resource scopes of every managed resource with a deny assignment. + [WirePath("applyToChildScopes")] + public bool? ApplyToChildScopes { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs new file mode 100644 index 0000000000000..14edf50fff1ca --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.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.Resources.Models +{ + /// denySettings Mode that defines denied actions. + public readonly partial struct DenySettingsMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DenySettingsMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DenyDeleteValue = "denyDelete"; + private const string DenyWriteAndDeleteValue = "denyWriteAndDelete"; + private const string NoneValue = "none"; + + /// Authorized users are able to read and modify the resources, but cannot delete. + public static DenySettingsMode DenyDelete { get; } = new DenySettingsMode(DenyDeleteValue); + /// Authorized users can read from a resource, but cannot modify or delete it. + public static DenySettingsMode DenyWriteAndDelete { get; } = new DenySettingsMode(DenyWriteAndDeleteValue); + /// No denyAssignments have been applied. + public static DenySettingsMode None { get; } = new DenySettingsMode(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(DenySettingsMode left, DenySettingsMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DenySettingsMode left, DenySettingsMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DenySettingsMode(string value) => new DenySettingsMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DenySettingsMode other && Equals(other); + /// + public bool Equals(DenySettingsMode 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs new file mode 100644 index 0000000000000..b97021d5f01e7 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// denyAssignment settings applied to the resource. + public readonly partial struct DenyStatusMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DenyStatusMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DenyDeleteValue = "denyDelete"; + private const string NotSupportedValue = "notSupported"; + private const string InapplicableValue = "inapplicable"; + private const string DenyWriteAndDeleteValue = "denyWriteAndDelete"; + private const string RemovedBySystemValue = "removedBySystem"; + private const string NoneValue = "none"; + + /// Authorized users are able to read and modify the resources, but cannot delete. + public static DenyStatusMode DenyDelete { get; } = new DenyStatusMode(DenyDeleteValue); + /// Resource type does not support denyAssignments. + public static DenyStatusMode NotSupported { get; } = new DenyStatusMode(NotSupportedValue); + /// denyAssignments are not supported on resources outside the scope of the deployment stack. + public static DenyStatusMode Inapplicable { get; } = new DenyStatusMode(InapplicableValue); + /// Authorized users can only read from a resource, but cannot modify or delete it. + public static DenyStatusMode DenyWriteAndDelete { get; } = new DenyStatusMode(DenyWriteAndDeleteValue); + /// Deny assignment has been removed by Azure due to a resource management change (management group move, etc.). + public static DenyStatusMode RemovedBySystem { get; } = new DenyStatusMode(RemovedBySystemValue); + /// No denyAssignments have been applied. + public static DenyStatusMode None { get; } = new DenyStatusMode(NoneValue); + /// Determines if two values are the same. + public static bool operator ==(DenyStatusMode left, DenyStatusMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DenyStatusMode left, DenyStatusMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DenyStatusMode(string value) => new DenyStatusMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DenyStatusMode other && Equals(other); + /// + public bool Equals(DenyStatusMode 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs new file mode 100644 index 0000000000000..2042c0e1d26c6 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentParameter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentParameter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Value); +#else + using (JsonDocument document = JsonDocument.Parse(Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(DeploymentParameterType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(DeploymentParameterType); + } + if (Optional.IsDefined(Reference)) + { + writer.WritePropertyName("reference"u8); + writer.WriteObjectValue(Reference, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentParameter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentParameter(document.RootElement, options); + } + + internal static DeploymentParameter DeserializeDeploymentParameter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData value = default; + string type = default; + KeyVaultParameterReference reference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("reference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reference = KeyVaultParameterReference.DeserializeKeyVaultParameterReference(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentParameter(value, type, reference, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + builder.AppendLine($"'{Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentParameterType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentParameterType)) + { + builder.Append(" type: "); + if (DeploymentParameterType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentParameterType}'''"); + } + else + { + builder.AppendLine($"'{DeploymentParameterType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Reference), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" reference: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Reference)) + { + builder.Append(" reference: "); + BicepSerializationHelpers.AppendChildObject(builder, Reference, options, 2, false, " reference: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentParameter)} does not support writing '{options.Format}' format."); + } + } + + DeploymentParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentParameter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentParameter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs new file mode 100644 index 0000000000000..e810c066b72f0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Deployment parameter for the template. + public partial class DeploymentParameter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentParameter() + { + } + + /// Initializes a new instance of . + /// Input value to the parameter. + /// Type of the value. + /// Azure Key Vault parameter reference. + /// Keeps track of any properties unknown to the library. + internal DeploymentParameter(BinaryData value, string deploymentParameterType, KeyVaultParameterReference reference, IDictionary serializedAdditionalRawData) + { + Value = value; + DeploymentParameterType = deploymentParameterType; + Reference = reference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Input value to the parameter. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("value")] + public BinaryData Value { get; set; } + /// Type of the value. + [WirePath("type")] + public string DeploymentParameterType { get; set; } + /// Azure Key Vault parameter reference. + [WirePath("reference")] + public KeyVaultParameterReference Reference { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs new file mode 100644 index 0000000000000..205eeb12438fe --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + internal partial class DeploymentStackListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStackListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStackListResult(document.RootElement, options); + } + + internal static DeploymentStackListResult DeserializeDeploymentStackListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentStackData.DeserializeDeploymentStackData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStackListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStackListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs new file mode 100644 index 0000000000000..8b6ba6dd33ca0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// List of Deployment stacks. + internal partial class DeploymentStackListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DeploymentStackListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// An array of Deployment stacks. + /// The URL to use for getting the next set of results. + /// Keeps track of any properties unknown to the library. + internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// An array of Deployment stacks. + public IReadOnlyList Value { get; } + /// The URL to use for getting the next set of results. + public string NextLink { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs new file mode 100644 index 0000000000000..ebbfe6e82c390 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// State of the deployment stack. + public readonly partial struct DeploymentStackProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeploymentStackProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "creating"; + private const string ValidatingValue = "validating"; + private const string WaitingValue = "waiting"; + private const string DeployingValue = "deploying"; + private const string CancelingValue = "canceling"; + private const string UpdatingDenyAssignmentsValue = "updatingDenyAssignments"; + private const string DeletingResourcesValue = "deletingResources"; + private const string SucceededValue = "succeeded"; + private const string FailedValue = "failed"; + private const string CanceledValue = "canceled"; + private const string DeletingValue = "deleting"; + + /// creating. + public static DeploymentStackProvisioningState Creating { get; } = new DeploymentStackProvisioningState(CreatingValue); + /// validating. + public static DeploymentStackProvisioningState Validating { get; } = new DeploymentStackProvisioningState(ValidatingValue); + /// waiting. + public static DeploymentStackProvisioningState Waiting { get; } = new DeploymentStackProvisioningState(WaitingValue); + /// deploying. + public static DeploymentStackProvisioningState Deploying { get; } = new DeploymentStackProvisioningState(DeployingValue); + /// canceling. + public static DeploymentStackProvisioningState Canceling { get; } = new DeploymentStackProvisioningState(CancelingValue); + /// updatingDenyAssignments. + public static DeploymentStackProvisioningState UpdatingDenyAssignments { get; } = new DeploymentStackProvisioningState(UpdatingDenyAssignmentsValue); + /// deletingResources. + public static DeploymentStackProvisioningState DeletingResources { get; } = new DeploymentStackProvisioningState(DeletingResourcesValue); + /// succeeded. + public static DeploymentStackProvisioningState Succeeded { get; } = new DeploymentStackProvisioningState(SucceededValue); + /// failed. + public static DeploymentStackProvisioningState Failed { get; } = new DeploymentStackProvisioningState(FailedValue); + /// canceled. + public static DeploymentStackProvisioningState Canceled { get; } = new DeploymentStackProvisioningState(CanceledValue); + /// deleting. + public static DeploymentStackProvisioningState Deleting { get; } = new DeploymentStackProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(DeploymentStackProvisioningState left, DeploymentStackProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeploymentStackProvisioningState left, DeploymentStackProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DeploymentStackProvisioningState(string value) => new DeploymentStackProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeploymentStackProvisioningState other && Equals(other); + /// + public bool Equals(DeploymentStackProvisioningState 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs new file mode 100644 index 0000000000000..42cf2b4ee0638 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentStackValidateProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ActionOnUnmanage)) + { + writer.WritePropertyName("actionOnUnmanage"u8); + writer.WriteObjectValue(ActionOnUnmanage, options); + } + if (Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (Optional.IsDefined(DenySettings)) + { + writer.WritePropertyName("denySettings"u8); + writer.WriteObjectValue(DenySettings, options); + } + if (Optional.IsDefined(DeploymentScope)) + { + writer.WritePropertyName("deploymentScope"u8); + writer.WriteStringValue(DeploymentScope); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteStartObject(); + foreach (var item in Parameters) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(TemplateLink)) + { + writer.WritePropertyName("templateLink"u8); + writer.WriteObjectValue(TemplateLink, options); + } + if (Optional.IsCollectionDefined(ValidatedResources)) + { + writer.WritePropertyName("validatedResources"u8); + writer.WriteStartArray(); + foreach (var item in ValidatedResources) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStackValidateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStackValidateProperties(document.RootElement, options); + } + + internal static DeploymentStackValidateProperties DeserializeDeploymentStackValidateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ActionOnUnmanage actionOnUnmanage = default; + string correlationId = default; + DenySettings denySettings = default; + string deploymentScope = default; + string description = default; + IDictionary parameters = default; + DeploymentStacksTemplateLink templateLink = default; + IList validatedResources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("actionOnUnmanage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actionOnUnmanage = ActionOnUnmanage.DeserializeActionOnUnmanage(property.Value, options); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("denySettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denySettings = DenySettings.DeserializeDenySettings(property.Value, options); + continue; + } + if (property.NameEquals("deploymentScope"u8)) + { + deploymentScope = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, DeploymentParameter.DeserializeDeploymentParameter(property0.Value, options)); + } + parameters = dictionary; + continue; + } + if (property.NameEquals("templateLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property.Value, options); + continue; + } + if (property.NameEquals("validatedResources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + validatedResources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStackValidateProperties( + actionOnUnmanage, + correlationId, + denySettings, + deploymentScope, + description, + parameters ?? new ChangeTrackingDictionary(), + templateLink, + validatedResources ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ActionOnUnmanage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" actionOnUnmanage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ActionOnUnmanage)) + { + builder.Append(" actionOnUnmanage: "); + BicepSerializationHelpers.AppendChildObject(builder, ActionOnUnmanage, options, 2, false, " actionOnUnmanage: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CorrelationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" correlationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CorrelationId)) + { + builder.Append(" correlationId: "); + if (CorrelationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CorrelationId}'''"); + } + else + { + builder.AppendLine($"'{CorrelationId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DenySettings), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" denySettings: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DenySettings)) + { + builder.Append(" denySettings: "); + BicepSerializationHelpers.AppendChildObject(builder, DenySettings, options, 2, false, " denySettings: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentScope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentScope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentScope)) + { + builder.Append(" deploymentScope: "); + if (DeploymentScope.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentScope}'''"); + } + else + { + builder.AppendLine($"'{DeploymentScope}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Parameters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" parameters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Parameters)) + { + if (Parameters.Any()) + { + builder.Append(" parameters: "); + builder.AppendLine("{"); + foreach (var item in Parameters) + { + builder.Append($" '{item.Key}': "); + BicepSerializationHelpers.AppendChildObject(builder, item.Value, options, 4, false, " parameters: "); + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TemplateLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" templateLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TemplateLink)) + { + builder.Append(" templateLink: "); + BicepSerializationHelpers.AppendChildObject(builder, TemplateLink, options, 2, false, " templateLink: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ValidatedResources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" validatedResources: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ValidatedResources)) + { + if (ValidatedResources.Any()) + { + builder.Append(" validatedResources: "); + builder.AppendLine("["); + foreach (var item in ValidatedResources) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " validatedResources: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStackValidateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStackValidateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs new file mode 100644 index 0000000000000..f3ec759d52759 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The Deployment stack validation result details. + public partial class DeploymentStackValidateProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentStackValidateProperties() + { + Parameters = new ChangeTrackingDictionary(); + ValidatedResources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. + /// The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. + /// The Deployment stack deny settings. + /// The Deployment stack deployment scope. + /// The Deployment stack validation description. + /// Deployment parameters. + /// The URI of the template. + /// The array of resources that were validated. + /// Keeps track of any properties unknown to the library. + internal DeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, string correlationId, DenySettings denySettings, string deploymentScope, string description, IDictionary parameters, DeploymentStacksTemplateLink templateLink, IList validatedResources, IDictionary serializedAdditionalRawData) + { + ActionOnUnmanage = actionOnUnmanage; + CorrelationId = correlationId; + DenySettings = denySettings; + DeploymentScope = deploymentScope; + Description = description; + Parameters = parameters; + TemplateLink = templateLink; + ValidatedResources = validatedResources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. + [WirePath("actionOnUnmanage")] + public ActionOnUnmanage ActionOnUnmanage { get; set; } + /// The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. + [WirePath("correlationId")] + public string CorrelationId { get; set; } + /// The Deployment stack deny settings. + [WirePath("denySettings")] + public DenySettings DenySettings { get; set; } + /// The Deployment stack deployment scope. + [WirePath("deploymentScope")] + public string DeploymentScope { get; set; } + /// The Deployment stack validation description. + [WirePath("description")] + public string Description { get; set; } + /// Deployment parameters. + [WirePath("parameters")] + public IDictionary Parameters { get; } + /// The URI of the template. + [WirePath("templateLink")] + public DeploymentStacksTemplateLink TemplateLink { get; set; } + /// The array of resources that were validated. + [WirePath("validatedResources")] + public IList ValidatedResources { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs new file mode 100644 index 0000000000000..1656965c7f31d --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentStackValidateResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStackValidateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStackValidateResult(document.RootElement, options); + } + + internal static DeploymentStackValidateResult DeserializeDeploymentStackValidateResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeploymentStackValidateProperties properties = default; + ResponseError error = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DeploymentStackValidateProperties.DeserializeDeploymentStackValidateProperties(property.Value, options); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStackValidateResult( + id, + name, + type, + systemData, + properties, + error, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStackValidateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStackValidateResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs new file mode 100644 index 0000000000000..cb00b8393f8be --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The Deployment stack validation result. + public partial class DeploymentStackValidateResult : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentStackValidateResult() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The validation result details. + /// The error detail. + /// Keeps track of any properties unknown to the library. + internal DeploymentStackValidateResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeploymentStackValidateProperties properties, ResponseError error, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The validation result details. + [WirePath("properties")] + public DeploymentStackValidateProperties Properties { get; set; } + /// The error detail. + [WirePath("error")] + public ResponseError Error { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs new file mode 100644 index 0000000000000..a2c8a225d0952 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + internal partial class DeploymentStacksDebugSetting : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(DetailLevel)) + { + writer.WritePropertyName("detailLevel"u8); + writer.WriteStringValue(DetailLevel); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStacksDebugSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStacksDebugSetting(document.RootElement, options); + } + + internal static DeploymentStacksDebugSetting DeserializeDeploymentStacksDebugSetting(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string detailLevel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("detailLevel"u8)) + { + detailLevel = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStacksDebugSetting(detailLevel, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DetailLevel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" detailLevel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DetailLevel)) + { + builder.Append(" detailLevel: "); + if (DetailLevel.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DetailLevel}'''"); + } + else + { + builder.AppendLine($"'{DetailLevel}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStacksDebugSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStacksDebugSetting(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs new file mode 100644 index 0000000000000..b1c41ea88b884 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The debug setting. + internal partial class DeploymentStacksDebugSetting + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentStacksDebugSetting() + { + } + + /// Initializes a new instance of . + /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. + /// Keeps track of any properties unknown to the library. + internal DeploymentStacksDebugSetting(string detailLevel, IDictionary serializedAdditionalRawData) + { + DetailLevel = detailLevel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. + [WirePath("detailLevel")] + public string DetailLevel { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs new file mode 100644 index 0000000000000..ec56105c734f2 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + public readonly partial struct DeploymentStacksDeleteDetachEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeploymentStacksDeleteDetachEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "delete"; + private const string DetachValue = "detach"; + + /// delete. + public static DeploymentStacksDeleteDetachEnum Delete { get; } = new DeploymentStacksDeleteDetachEnum(DeleteValue); + /// detach. + public static DeploymentStacksDeleteDetachEnum Detach { get; } = new DeploymentStacksDeleteDetachEnum(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(DeploymentStacksDeleteDetachEnum left, DeploymentStacksDeleteDetachEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeploymentStacksDeleteDetachEnum left, DeploymentStacksDeleteDetachEnum right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DeploymentStacksDeleteDetachEnum(string value) => new DeploymentStacksDeleteDetachEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeploymentStacksDeleteDetachEnum other && Equals(other); + /// + public bool Equals(DeploymentStacksDeleteDetachEnum 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs new file mode 100644 index 0000000000000..2f4566cc45368 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentStacksParametersLink : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (Optional.IsDefined(ContentVersion)) + { + writer.WritePropertyName("contentVersion"u8); + writer.WriteStringValue(ContentVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStacksParametersLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStacksParametersLink(document.RootElement, options); + } + + internal static DeploymentStacksParametersLink DeserializeDeploymentStacksParametersLink(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri uri = default; + string contentVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("contentVersion"u8)) + { + contentVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStacksParametersLink(uri, contentVersion, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContentVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" contentVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContentVersion)) + { + builder.Append(" contentVersion: "); + if (ContentVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ContentVersion}'''"); + } + else + { + builder.AppendLine($"'{ContentVersion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStacksParametersLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStacksParametersLink(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs new file mode 100644 index 0000000000000..72e7f5a22a7fa --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Entity representing the reference to the deployment parameters. + public partial class DeploymentStacksParametersLink + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The URI of the parameters file. + /// is null. + public DeploymentStacksParametersLink(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Uri = uri; + } + + /// Initializes a new instance of . + /// The URI of the parameters file. + /// If included, must match the ContentVersion in the template. + /// Keeps track of any properties unknown to the library. + internal DeploymentStacksParametersLink(Uri uri, string contentVersion, IDictionary serializedAdditionalRawData) + { + Uri = uri; + ContentVersion = contentVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeploymentStacksParametersLink() + { + } + + /// The URI of the parameters file. + [WirePath("uri")] + public Uri Uri { get; set; } + /// If included, must match the ContentVersion in the template. + [WirePath("contentVersion")] + public string ContentVersion { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs new file mode 100644 index 0000000000000..dc4c06562d8df --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentStacksTemplateLink : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(RelativePath)) + { + writer.WritePropertyName("relativePath"u8); + writer.WriteStringValue(RelativePath); + } + if (Optional.IsDefined(QueryString)) + { + writer.WritePropertyName("queryString"u8); + writer.WriteStringValue(QueryString); + } + if (Optional.IsDefined(ContentVersion)) + { + writer.WritePropertyName("contentVersion"u8); + writer.WriteStringValue(ContentVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStacksTemplateLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStacksTemplateLink(document.RootElement, options); + } + + internal static DeploymentStacksTemplateLink DeserializeDeploymentStacksTemplateLink(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri uri = default; + string id = default; + string relativePath = default; + string queryString = default; + string contentVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("relativePath"u8)) + { + relativePath = property.Value.GetString(); + continue; + } + if (property.NameEquals("queryString"u8)) + { + queryString = property.Value.GetString(); + continue; + } + if (property.NameEquals("contentVersion"u8)) + { + contentVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStacksTemplateLink( + uri, + id, + relativePath, + queryString, + contentVersion, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RelativePath), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" relativePath: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RelativePath)) + { + builder.Append(" relativePath: "); + if (RelativePath.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RelativePath}'''"); + } + else + { + builder.AppendLine($"'{RelativePath}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(QueryString), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" queryString: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(QueryString)) + { + builder.Append(" queryString: "); + if (QueryString.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{QueryString}'''"); + } + else + { + builder.AppendLine($"'{QueryString}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContentVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" contentVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContentVersion)) + { + builder.Append(" contentVersion: "); + if (ContentVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ContentVersion}'''"); + } + else + { + builder.AppendLine($"'{ContentVersion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStacksTemplateLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStacksTemplateLink(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs new file mode 100644 index 0000000000000..6da14d9e0ac6d --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Entity representing the reference to the template. + public partial class DeploymentStacksTemplateLink + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentStacksTemplateLink() + { + } + + /// Initializes a new instance of . + /// The URI of the template to deploy. Use either the uri or id property, but not both. + /// The resourceId of a Template Spec. Use either the id or uri property, but not both. + /// The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs. + /// The query string (for example, a SAS token) to be used with the templateLink URI. + /// If included, must match the ContentVersion in the template. + /// Keeps track of any properties unknown to the library. + internal DeploymentStacksTemplateLink(Uri uri, string id, string relativePath, string queryString, string contentVersion, IDictionary serializedAdditionalRawData) + { + Uri = uri; + Id = id; + RelativePath = relativePath; + QueryString = queryString; + ContentVersion = contentVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URI of the template to deploy. Use either the uri or id property, but not both. + [WirePath("uri")] + public Uri Uri { get; set; } + /// The resourceId of a Template Spec. Use either the id or uri property, but not both. + [WirePath("id")] + public string Id { get; set; } + /// The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs. + [WirePath("relativePath")] + public string RelativePath { get; set; } + /// The query string (for example, a SAS token) to be used with the templateLink URI. + [WirePath("queryString")] + public string QueryString { get; set; } + /// If included, must match the ContentVersion in the template. + [WirePath("contentVersion")] + public string ContentVersion { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.Serialization.cs new file mode 100644 index 0000000000000..19da8ae7126ba --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.Serialization.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class KeyVaultParameterReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyVaultParameterReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("keyVault"u8); + JsonSerializer.Serialize(writer, KeyVault); + writer.WritePropertyName("secretName"u8); + writer.WriteStringValue(SecretName); + if (Optional.IsDefined(SecretVersion)) + { + writer.WritePropertyName("secretVersion"u8); + writer.WriteStringValue(SecretVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + KeyVaultParameterReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyVaultParameterReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultParameterReference(document.RootElement, options); + } + + internal static KeyVaultParameterReference DeserializeKeyVaultParameterReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource keyVault = default; + string secretName = default; + string secretVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyVault"u8)) + { + keyVault = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("secretName"u8)) + { + secretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("secretVersion"u8)) + { + secretVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeyVaultParameterReference(keyVault, secretName, secretVersion, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("KeyVaultId", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVault: "); + builder.AppendLine("{"); + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(KeyVault)) + { + builder.Append(" keyVault: "); + BicepSerializationHelpers.AppendChildObject(builder, KeyVault, options, 2, false, " keyVault: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecretName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secretName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecretName)) + { + builder.Append(" secretName: "); + if (SecretName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SecretName}'''"); + } + else + { + builder.AppendLine($"'{SecretName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecretVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secretVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecretVersion)) + { + builder.Append(" secretVersion: "); + if (SecretVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SecretVersion}'''"); + } + else + { + builder.AppendLine($"'{SecretVersion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(KeyVaultParameterReference)} does not support writing '{options.Format}' format."); + } + } + + KeyVaultParameterReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeKeyVaultParameterReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyVaultParameterReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.cs new file mode 100644 index 0000000000000..a87236944709f --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/KeyVaultParameterReference.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Azure Key Vault parameter reference. + public partial class KeyVaultParameterReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Key Vault reference. + /// Azure Key Vault secret name. + /// or is null. + public KeyVaultParameterReference(WritableSubResource keyVault, string secretName) + { + Argument.AssertNotNull(keyVault, nameof(keyVault)); + Argument.AssertNotNull(secretName, nameof(secretName)); + + KeyVault = keyVault; + SecretName = secretName; + } + + /// Initializes a new instance of . + /// Azure Key Vault reference. + /// Azure Key Vault secret name. + /// Azure Key Vault secret version. + /// Keeps track of any properties unknown to the library. + internal KeyVaultParameterReference(WritableSubResource keyVault, string secretName, string secretVersion, IDictionary serializedAdditionalRawData) + { + KeyVault = keyVault; + SecretName = secretName; + SecretVersion = secretVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KeyVaultParameterReference() + { + } + + /// Azure Key Vault reference. + internal WritableSubResource KeyVault { get; set; } + /// Gets or sets Id. + [WirePath("keyVault.id")] + public ResourceIdentifier KeyVaultId + { + get => KeyVault is null ? default : KeyVault.Id; + set + { + if (KeyVault is null) + KeyVault = new WritableSubResource(); + KeyVault.Id = value; + } + } + + /// Azure Key Vault secret name. + [WirePath("secretName")] + public string SecretName { get; set; } + /// Azure Key Vault secret version. + [WirePath("secretVersion")] + public string SecretVersion { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.Serialization.cs new file mode 100644 index 0000000000000..b3c9259d66a2b --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class ManagedResourceReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(DenyStatus)) + { + writer.WritePropertyName("denyStatus"u8); + writer.WriteStringValue(DenyStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedResourceReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedResourceReference(document.RootElement, options); + } + + internal static ManagedResourceReference DeserializeManagedResourceReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceStatusMode? status = default; + DenyStatusMode? denyStatus = default; + string id = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ResourceStatusMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("denyStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + denyStatus = new DenyStatusMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedResourceReference(id, serializedAdditionalRawData, status, denyStatus); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DenyStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" denyStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DenyStatus)) + { + builder.Append(" denyStatus: "); + builder.AppendLine($"'{DenyStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ManagedResourceReference)} does not support writing '{options.Format}' format."); + } + } + + ManagedResourceReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedResourceReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedResourceReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.cs new file mode 100644 index 0000000000000..057cf0eaba60c --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ManagedResourceReference.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The managed resource model. + public partial class ManagedResourceReference : ResourceReferenceAutoGenerated + { + /// Initializes a new instance of . + public ManagedResourceReference() + { + } + + /// Initializes a new instance of . + /// The resourceId of a resource managed by the deployment stack. + /// Keeps track of any properties unknown to the library. + /// Current management state of the resource in the deployment stack. + /// denyAssignment settings applied to the resource. + internal ManagedResourceReference(string id, IDictionary serializedAdditionalRawData, ResourceStatusMode? status, DenyStatusMode? denyStatus) : base(id, serializedAdditionalRawData) + { + Status = status; + DenyStatus = denyStatus; + } + + /// Current management state of the resource in the deployment stack. + [WirePath("status")] + public ResourceStatusMode? Status { get; set; } + /// denyAssignment settings applied to the resource. + [WirePath("denyStatus")] + public DenyStatusMode? DenyStatus { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.Serialization.cs new file mode 100644 index 0000000000000..7f1b67d46ed50 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class ResourceReferenceAutoGenerated : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceReferenceAutoGenerated)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ResourceReferenceAutoGenerated IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceReferenceAutoGenerated)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceReferenceAutoGenerated(document.RootElement, options); + } + + internal static ResourceReferenceAutoGenerated DeserializeResourceReferenceAutoGenerated(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceReferenceAutoGenerated(id, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ResourceReferenceAutoGenerated)} does not support writing '{options.Format}' format."); + } + } + + ResourceReferenceAutoGenerated IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceReferenceAutoGenerated(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceReferenceAutoGenerated)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.cs new file mode 100644 index 0000000000000..c49b3ed0893f5 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceAutoGenerated.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The resourceId model. + public partial class ResourceReferenceAutoGenerated + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ResourceReferenceAutoGenerated() + { + } + + /// Initializes a new instance of . + /// The resourceId of a resource managed by the deployment stack. + /// Keeps track of any properties unknown to the library. + internal ResourceReferenceAutoGenerated(string id, IDictionary serializedAdditionalRawData) + { + Id = id; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resourceId of a resource managed by the deployment stack. + [WirePath("id")] + public string Id { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.Serialization.cs new file mode 100644 index 0000000000000..26e718825ebea --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class ResourceReferenceExtended : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceReferenceExtended)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ResourceReferenceExtended IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceReferenceExtended)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceReferenceExtended(document.RootElement, options); + } + + internal static ResourceReferenceExtended DeserializeResourceReferenceExtended(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResponseError error = default; + string id = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceReferenceExtended(id, serializedAdditionalRawData, error); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ResourceReferenceExtended)} does not support writing '{options.Format}' format."); + } + } + + ResourceReferenceExtended IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResourceReferenceExtended(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceReferenceExtended)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.cs new file mode 100644 index 0000000000000..f8a45a98a0cd7 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceReferenceExtended.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The resourceId extended model. This is used to document failed resources with a resourceId and a corresponding error. + public partial class ResourceReferenceExtended : ResourceReferenceAutoGenerated + { + /// Initializes a new instance of . + public ResourceReferenceExtended() + { + } + + /// Initializes a new instance of . + /// The resourceId of a resource managed by the deployment stack. + /// Keeps track of any properties unknown to the library. + /// The error detail. + internal ResourceReferenceExtended(string id, IDictionary serializedAdditionalRawData, ResponseError error) : base(id, serializedAdditionalRawData) + { + Error = error; + } + + /// The error detail. + [WirePath("error")] + public ResponseError Error { get; set; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs new file mode 100644 index 0000000000000..4747b2f489e4f --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.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.Resources.Models +{ + /// Current management state of the resource in the deployment stack. + public readonly partial struct ResourceStatusMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceStatusMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ManagedValue = "managed"; + private const string RemoveDenyFailedValue = "removeDenyFailed"; + private const string DeleteFailedValue = "deleteFailed"; + + /// This resource is managed by the deployment stack. + public static ResourceStatusMode Managed { get; } = new ResourceStatusMode(ManagedValue); + /// Unable to remove the deny assignment on resource. + public static ResourceStatusMode RemoveDenyFailed { get; } = new ResourceStatusMode(RemoveDenyFailedValue); + /// Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. + public static ResourceStatusMode DeleteFailed { get; } = new ResourceStatusMode(DeleteFailedValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceStatusMode left, ResourceStatusMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceStatusMode left, ResourceStatusMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ResourceStatusMode(string value) => new ResourceStatusMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceStatusMode other && Equals(other); + /// + public bool Equals(ResourceStatusMode 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs new file mode 100644 index 0000000000000..aedc4bc16cdd0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The UnmanageActionManagementGroupMode. + public readonly partial struct UnmanageActionManagementGroupMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UnmanageActionManagementGroupMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "delete"; + private const string DetachValue = "detach"; + + /// delete. + public static UnmanageActionManagementGroupMode Delete { get; } = new UnmanageActionManagementGroupMode(DeleteValue); + /// detach. + public static UnmanageActionManagementGroupMode Detach { get; } = new UnmanageActionManagementGroupMode(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(UnmanageActionManagementGroupMode left, UnmanageActionManagementGroupMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UnmanageActionManagementGroupMode left, UnmanageActionManagementGroupMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator UnmanageActionManagementGroupMode(string value) => new UnmanageActionManagementGroupMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UnmanageActionManagementGroupMode other && Equals(other); + /// + public bool Equals(UnmanageActionManagementGroupMode 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs new file mode 100644 index 0000000000000..15a08f95fe5b6 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The UnmanageActionResourceGroupMode. + public readonly partial struct UnmanageActionResourceGroupMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UnmanageActionResourceGroupMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "delete"; + private const string DetachValue = "detach"; + + /// delete. + public static UnmanageActionResourceGroupMode Delete { get; } = new UnmanageActionResourceGroupMode(DeleteValue); + /// detach. + public static UnmanageActionResourceGroupMode Detach { get; } = new UnmanageActionResourceGroupMode(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(UnmanageActionResourceGroupMode left, UnmanageActionResourceGroupMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UnmanageActionResourceGroupMode left, UnmanageActionResourceGroupMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator UnmanageActionResourceGroupMode(string value) => new UnmanageActionResourceGroupMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UnmanageActionResourceGroupMode other && Equals(other); + /// + public bool Equals(UnmanageActionResourceGroupMode 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/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs new file mode 100644 index 0000000000000..e748cd8d8b0c1 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The UnmanageActionResourceMode. + public readonly partial struct UnmanageActionResourceMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UnmanageActionResourceMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "delete"; + private const string DetachValue = "detach"; + + /// delete. + public static UnmanageActionResourceMode Delete { get; } = new UnmanageActionResourceMode(DeleteValue); + /// detach. + public static UnmanageActionResourceMode Detach { get; } = new UnmanageActionResourceMode(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(UnmanageActionResourceMode left, UnmanageActionResourceMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UnmanageActionResourceMode left, UnmanageActionResourceMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator UnmanageActionResourceMode(string value) => new UnmanageActionResourceMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UnmanageActionResourceMode other && Equals(other); + /// + public bool Equals(UnmanageActionResourceMode 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/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs index 0aaf5c1cf9595..643b645166559 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentRestOperations.cs @@ -32,7 +32,7 @@ public DeploymentRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs new file mode 100644 index 0000000000000..1ba32e2adadc6 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -0,0 +1,567 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + internal partial class DeploymentStacksRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DeploymentStacksRestOperations. + /// 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 DeploymentStacksRestOperations(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 ?? "2024-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendPath("/exportTemplate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendPath("/exportTemplate", false); + 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager. + /// The resource scope. + /// Name of the deployment stack. + /// Deployment stack to validate. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateStackAtScopeRequest(scope, deploymentStackName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 400: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager. + /// The resource scope. + /// Name of the deployment stack. + /// Deployment stack to validate. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response ValidateStackAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateStackAtScopeRequest(scope, deploymentStackName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 400: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListAtCopeRequestUri(string scope) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal Core.HttpMessage CreateListAtCopeRequest(string scope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the Deployment stacks within the specified scope. + /// The resource scope. + /// The cancellation token to use. + /// is null. + public async Task> ListAtCopeAsync(string scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + + using var message = CreateListAtCopeRequest(scope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the Deployment stacks within the specified scope. + /// The resource scope. + /// The cancellation token to use. + /// is null. + public Response ListAtCope(string scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + + using var message = CreateListAtCopeRequest(scope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, 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, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a Deployment stack at specific scope. + /// The resource scope. + /// Name of the deployment stack. + /// Deployment stack supplied to the operation. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateAtScopeRequest(scope, deploymentStackName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a Deployment stack at specific scope. + /// The resource scope. + /// Name of the deployment stack. + /// Deployment stack supplied to the operation. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateAtScopeRequest(scope, deploymentStackName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetAtScopeRequestUri(string scope, string deploymentStackName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymentStackName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a Deployment stack with a given name at specific scope. + /// The resource scope. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var message = CreateGetAtScopeRequest(scope, deploymentStackName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeploymentStackData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a Deployment stack with a given name at specific scope. + /// The resource scope. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var message = CreateGetAtScopeRequest(scope, deploymentStackName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeploymentStackData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteAtScopeRequestUri(string scope, string deploymentStackName, UnmanageActionResourceMode? unmanageActionResources, UnmanageActionResourceGroupMode? unmanageActionResourceGroups, UnmanageActionManagementGroupMode? unmanageActionManagementGroups, bool? bypassStackOutOfSyncError) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + if (unmanageActionResources != null) + { + uri.AppendQuery("unmanageAction.Resources", unmanageActionResources.Value.ToString(), true); + } + if (unmanageActionResourceGroups != null) + { + uri.AppendQuery("unmanageAction.ResourceGroups", unmanageActionResourceGroups.Value.ToString(), true); + } + if (unmanageActionManagementGroups != null) + { + uri.AppendQuery("unmanageAction.ManagementGroups", unmanageActionManagementGroups.Value.ToString(), true); + } + if (bypassStackOutOfSyncError != null) + { + uri.AppendQuery("bypassStackOutOfSyncError", bypassStackOutOfSyncError.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal Core.HttpMessage CreateDeleteAtScopeRequest(string scope, string deploymentStackName, UnmanageActionResourceMode? unmanageActionResources, UnmanageActionResourceGroupMode? unmanageActionResourceGroups, UnmanageActionManagementGroupMode? unmanageActionManagementGroups, bool? bypassStackOutOfSyncError) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + if (unmanageActionResources != null) + { + uri.AppendQuery("unmanageAction.Resources", unmanageActionResources.Value.ToString(), true); + } + if (unmanageActionResourceGroups != null) + { + uri.AppendQuery("unmanageAction.ResourceGroups", unmanageActionResourceGroups.Value.ToString(), true); + } + if (unmanageActionManagementGroups != null) + { + uri.AppendQuery("unmanageAction.ManagementGroups", unmanageActionManagementGroups.Value.ToString(), true); + } + if (bypassStackOutOfSyncError != null) + { + uri.AppendQuery("bypassStackOutOfSyncError", bypassStackOutOfSyncError.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a Deployment stack by name at specific scope. When operation completes, status code 200 returned without content. + /// The resource scope. + /// Name of the deployment stack. + /// Flag to indicate delete rather than detach for unmanaged resources. + /// Flag to indicate delete rather than detach for unmanaged resource groups. + /// Flag to indicate delete rather than detach for unmanaged management groups. + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task DeleteAtScopeAsync(string scope, string deploymentStackName, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var message = CreateDeleteAtScopeRequest(scope, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a Deployment stack by name at specific scope. When operation completes, status code 200 returned without content. + /// The resource scope. + /// Name of the deployment stack. + /// Flag to indicate delete rather than detach for unmanaged resources. + /// Flag to indicate delete rather than detach for unmanaged resource groups. + /// Flag to indicate delete rather than detach for unmanaged management groups. + /// Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response DeleteAtScope(string scope, string deploymentStackName, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var message = CreateDeleteAtScopeRequest(scope, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListAtCopeNextPageRequestUri(string nextLink, string scope) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal Core.HttpMessage CreateListAtCopeNextPageRequest(string nextLink, string scope) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the Deployment stacks within the specified scope. + /// The URL to the next page of results. + /// The resource scope. + /// The cancellation token to use. + /// or is null. + public async Task> ListAtCopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(scope, nameof(scope)); + + using var message = CreateListAtCopeNextPageRequest(nextLink, scope); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the Deployment stacks within the specified scope. + /// The URL to the next page of results. + /// The resource scope. + /// The cancellation token to use. + /// or is null. + public Response ListAtCopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNull(scope, nameof(scope)); + + using var message = CreateListAtCopeNextPageRequest(nextLink, scope); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs index d649c1f67d00b..64052ef2763d9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public DeploymentsRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-01"; + _apiVersion = apiVersion ?? "2024-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index e4ddef1eeb946..02926d8c70989 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -34,12 +34,17 @@ patch-initializer-customization: Properties: 'new ArmDeploymentProperties(current.Properties.Mode.HasValue ? current.Properties.Mode.Value : ArmDeploymentMode.Incremental)' request-path-to-parent: + #/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate: /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + #/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} # setting these to the same parent will automatically merge these operations /providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} + #/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: /{scope}/providers/Microsoft.Resources/deploymentStacks + #/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: /{scope}/providers/Microsoft.Resources/deploymentStacks + #/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: /{scope}/providers/Microsoft.Resources/deploymentStacks request-path-to-scope-resource-types: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName}: - subscriptions @@ -51,6 +56,14 @@ request-path-to-scope-resource-types: - resourceGroups - managementGroups - tenant + /{scope}/providers/Microsoft.Resources/deploymentStacks: + - subscriptions + - resourceGroups + - managementGroups + /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate: + - subscriptions + - resourceGroups + - managementGroups override-operation-name: DeploymentOperations_ListAtScope: GetDeploymentOperations DeploymentOperations_GetAtScope: GetDeploymentOperation @@ -64,6 +77,8 @@ override-operation-name: Deployments_CheckExistenceAtScope: CheckExistence jitRequests_ListBySubscription: GetJitRequestDefinitions Deployments_CalculateTemplateHash: CalculateDeploymentTemplateHash + DeploymentStacks_ExportTemplateAtScope: ExportTemplate + DeploymentStacks_ValidateStackAtScope: ValidateStack operation-groups-to-omit: Providers;ProviderResourceTypes;Resources;ResourceGroups;Tags;Subscriptions;Tenants @@ -155,6 +170,24 @@ directive: - remove-operation: Applications_DeleteById - remove-operation: Applications_CreateOrUpdateById - remove-operation: Applications_UpdateById + - remove-operation: DeploymentStacks_ExportTemplateAtSubscription + - remove-operation: DeploymentStacks_ExportTemplateAtResourceGroup + - remove-operation: DeploymentStacks_ExportTemplateAtManagementGroup + - remove-operation: DeploymentStacks_ValidateStackAtResourceGroup + - remove-operation: DeploymentStacks_ValidateStackAtSubscription + - remove-operation: DeploymentStacks_ValidateStackAtManagementGroup + - remove-operation: DeploymentStacks_ListAtResourceGroup + - remove-operation: DeploymentStacks_ListAtSubscription + - remove-operation: DeploymentStacks_ListAtManagementGroup + - remove-operation: DeploymentStacks_CreateOrUpdateAtResourceGroup + - remove-operation: DeploymentStacks_GetAtResourceGroup + - remove-operation: DeploymentStacks_DeleteAtResourceGroup + - remove-operation: DeploymentStacks_CreateOrUpdateAtSubscription + - remove-operation: DeploymentStacks_GetAtSubscription + - remove-operation: DeploymentStacks_DeleteAtSubscription + - remove-operation: DeploymentStacks_CreateOrUpdateAtManagementGroup + - remove-operation: DeploymentStacks_GetAtManagementGroup + - remove-operation: DeploymentStacks_DeleteAtManagementGroup - from: managedapplications.json where: $['x-ms-paths'] @@ -344,6 +377,291 @@ directive: where: $.definitions.DeploymentProperties transform: delete $.properties.parameters.additionalProperties + # Specify the duration format + - from: deploymentStacks.json + where: $.definitions + transform: > + $.DeploymentStackProperties.properties.duration['format'] = 'duration'; + # Add scope operations + - from: deploymentStacks.json + where: $.paths + transform: > + $['/{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate'] = { + "post": { + "tags": [ + "DeploymentStacks" + ], + "operationId": "DeploymentStacks_ExportTemplateAtScope", + "description": "Exports the template used to create the Deployment stack.", + "parameters": [ + { + "$ref": "./resources.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DeploymentStackNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns the Template or TemplateLink payload of the deployment stack.", + "schema": { + "$ref": "#/definitions/DeploymentStackTemplateDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/DeploymentStacksError" + } + } + } + } + }; + $['/{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate'] = { + "post": { + "tags": [ + "DeploymentStacks" + ], + "operationId": "DeploymentStacks_ValidateStackAtScope", + "description": "Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager.", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "parameters": [ + { + "$ref": "./resources.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DeploymentStackNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "deploymentStack", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeploymentStack" + }, + "description": "Deployment stack to validate." + } + ], + "responses": { + "200": { + "description": "OK - The validation operation result.", + "schema": { + "$ref": "#/definitions/DeploymentStackValidateResult" + } + }, + "202": { + "description": "Accepted - The validation request has been accepted for processing and the operation will complete asynchronously.", + "headers": { + "Location": { + "type": "string" + }, + "Retry-After": { + "type": "string", + "description": "Number of seconds to wait before polling for status." + } + } + }, + "400": { + "description": "Failed - The validation operation result.", + "x-ms-error-response": false, + "schema": { + "$ref": "#/definitions/DeploymentStackValidateResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/DeploymentStacksError" + } + } + } + } + }; + $['/{scope}/providers/Microsoft.Resources/deploymentStacks'] = { + "get": { + "tags": [ + "DeploymentStacks" + ], + "operationId": "DeploymentStacks_ListAtCope", + "description": "Lists all the Deployment stacks within the specified scope.", + "parameters": [ + { + "$ref": "./resources.json#/parameters/ScopeParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of Deployment stacks.", + "schema": { + "$ref": "#/definitions/DeploymentStackListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/DeploymentStacksError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }; + $['/{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}'] = { + "put": { + "tags": [ + "DeploymentStacks" + ], + "operationId": "DeploymentStacks_CreateOrUpdateAtScope", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "description": "Creates or updates a Deployment stack at specific scope.", + "parameters": [ + { + "$ref": "./resources.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DeploymentStackNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "deploymentStack", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeploymentStack" + }, + "description": "Deployment stack supplied to the operation." + } + ], + "responses": { + "200": { + "description": "OK - The Deployment stack update request has succeeded.", + "schema": { + "$ref": "#/definitions/DeploymentStack" + } + }, + "201": { + "description": "Deployment stack created.", + "schema": { + "$ref": "#/definitions/DeploymentStack" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/DeploymentStacksError" + } + } + } + }, + "get": { + "tags": [ + "DeploymentStacks" + ], + "operationId": "DeploymentStacks_GetAtScope", + "description": "Gets a Deployment stack with a given name at specific scope.", + "parameters": [ + { + "$ref": "./resources.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DeploymentStackNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns information about the Deployment stack.", + "schema": { + "$ref": "#/definitions/DeploymentStack" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/DeploymentStacksError" + } + } + } + }, + "delete": { + "tags": [ + "DeploymentStacks" + ], + "operationId": "DeploymentStacks_DeleteAtScope", + "description": "Deletes a Deployment stack by name at specific scope. When operation completes, status code 200 returned without content.", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "parameters": [ + { + "$ref": "./resources.json#/parameters/ScopeParameter" + }, + { + "$ref": "#/parameters/DeploymentStackNameParameter" + }, + { + "$ref": "#/parameters/DeleteResourceParameter" + }, + { + "$ref": "#/parameters/DeleteResourceGroupParameter" + }, + { + "$ref": "#/parameters/DeleteManagementGroupParameter" + }, + { + "$ref": "#/parameters/BypassStackOutOfSyncErrorParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Deployment stack deleted." + }, + "202": { + "description": "Accepted - Check location header for deletion status.", + "headers": { + "Location": { + "type": "string" + } + } + }, + "204": { + "description": "Deployment stack does not exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/DeploymentStacksError" + } + } + } + } + }; + ``` ### Tag: package-resources-2022-04 @@ -353,10 +671,11 @@ These settings apply only when `--tag=package-resources-2022-04` is specified on ```yaml $(tag) == 'package-resources-2022-04' input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/6acab48bdaef738f88de60abc41826e9914ad8ad/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/templateSpecs.json - - https://github.com/Azure/azure-rest-api-specs/blob/6acab48bdaef738f88de60abc41826e9914ad8ad/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/deploymentScripts.json - - https://github.com/Azure/azure-rest-api-specs/blob/6acab48bdaef738f88de60abc41826e9914ad8ad/specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/resources.json - - https://github.com/Azure/azure-rest-api-specs/blob/6acab48bdaef738f88de60abc41826e9914ad8ad/specification/resources/resource-manager/Microsoft.Solutions/stable/2019-07-01/managedapplications.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/templateSpecs.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/deploymentScripts.json + - https://github.com/Azure/azure-rest-api-specs/blob/1d994b314d45e33c6d63a9f7b729db8346b8ea0f/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/resources.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Solutions/stable/2019-07-01/managedapplications.json - https://github.com/Azure/azure-rest-api-specs/blob/6acab48bdaef738f88de60abc41826e9914ad8ad/specification/resources/resource-manager/Microsoft.Resources/stable/2023-11-01/bicepClient.json# + - https://github.com/Azure/azure-rest-api-specs/blob/1d994b314d45e33c6d63a9f7b729db8346b8ea0f/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/deploymentStacks.json ``` From 9f3a4ffefb984fb5c7e373a786409e259c0eb941 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 5 Jun 2024 11:27:35 +0800 Subject: [PATCH 02/19] Update --- ...esourceManager.Resources.netstandard2.0.cs | 109 ++++---- ...ion.cs => ArmDeploymentStackCollection.cs} | 130 ++++----- ...> ArmDeploymentStackData.Serialization.cs} | 38 +-- ...StackData.cs => ArmDeploymentStackData.cs} | 16 +- ...rmDeploymentStackResource.Serialization.cs | 26 ++ ...ource.cs => ArmDeploymentStackResource.cs} | 254 ++++++++++++------ .../src/Generated/ArmResourcesModelFactory.cs | 16 +- .../DeploymentStackResource.Serialization.cs | 26 -- .../Extensions/MockableResourcesArmClient.cs | 32 +-- .../Extensions/ResourcesExtensions.cs | 38 +-- .../ArmDeploymentStackOperationSource.cs | 38 +++ .../DeploymentStackOperationSource.cs | 38 --- ...DeploymentStackListResult.Serialization.cs | 8 +- .../Models/DeploymentStackListResult.cs | 6 +- ...ntStackTemplateDefinition.Serialization.cs | 196 ++++++++++++++ .../DeploymentStackTemplateDefinition.cs | 100 +++++++ .../DeploymentStacksRestOperations.cs | 118 ++++++-- .../src/autorest.md | 8 +- 18 files changed, 838 insertions(+), 359 deletions(-) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackCollection.cs => ArmDeploymentStackCollection.cs} (65%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackData.Serialization.cs => ArmDeploymentStackData.Serialization.cs} (95%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackData.cs => ArmDeploymentStackData.cs} (91%) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackResource.cs => ArmDeploymentStackResource.cs} (68%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index a442c4ae5262c..3878b409be211 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -264,26 +264,26 @@ protected ArmDeploymentScriptResource() { } public virtual Azure.Response Update(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class DeploymentStackCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public partial class ArmDeploymentStackCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected DeploymentStackCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + protected ArmDeploymentStackCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class DeploymentStackData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ArmDeploymentStackData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public DeploymentStackData(Azure.Core.AzureLocation location) { } + public ArmDeploymentStackData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Resources.Models.ActionOnUnmanage ActionOnUnmanage { get { throw null; } set { } } public bool? BypassStackOutOfSyncError { get { throw null; } set { } } public string CorrelationId { get { throw null; } } @@ -304,38 +304,40 @@ public DeploymentStackData(Azure.Core.AzureLocation location) { } public System.Collections.Generic.IReadOnlyList Resources { get { throw null; } } public System.BinaryData Template { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink TemplateLink { get { throw null; } set { } } - Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class DeploymentStackResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ArmDeploymentStackResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected DeploymentStackResource() { } - public virtual Azure.ResourceManager.Resources.DeploymentStackData Data { get { throw null; } } + protected ArmDeploymentStackResource() { } + public virtual Azure.ResourceManager.Resources.ArmDeploymentStackData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode? unmanageActionResources = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode?), Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode? unmanageActionResourceGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode?), Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode? unmanageActionManagementGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode?), bool? bypassStackOutOfSyncError = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode? unmanageActionResources = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode?), Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode? unmanageActionResourceGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode?), Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode? unmanageActionManagementGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode?), bool? bypassStackOutOfSyncError = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation ValidateStack(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ValidateStackAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ExportTemplate(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExportTemplateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation ValidateStack(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateStackAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class JitRequestCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -431,10 +433,10 @@ public static partial class ResourcesExtensions public static Azure.ResourceManager.Resources.ArmDeploymentScriptCollection GetArmDeploymentScripts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetArmDeploymentScripts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetArmDeploymentScriptsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetDeploymentStack(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetDeploymentStackAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.Resources.DeploymentStackResource GetDeploymentStackResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackResource GetArmDeploymentStackResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } public static Azure.Response GetJitRequest(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetJitRequestAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetJitRequestDefinitions(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -603,10 +605,10 @@ protected MockableResourcesArmClient() { } public virtual Azure.ResourceManager.Resources.ArmApplicationResource GetArmApplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentResource GetArmDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentScriptResource GetArmDeploymentScriptResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.Response GetDeploymentStack(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDeploymentStackAsync(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Resources.DeploymentStackResource GetDeploymentStackResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(Azure.Core.ResourceIdentifier scope) { throw null; } + public virtual Azure.Response GetArmDeploymentStack(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.ArmDeploymentStackResource GetArmDeploymentStackResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(Azure.Core.ResourceIdentifier scope) { throw null; } public virtual Azure.ResourceManager.Resources.JitRequestResource GetJitRequestResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ScriptLogResource GetScriptLogResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.TemplateSpecResource GetTemplateSpecResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -1205,6 +1207,7 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.ArmDeploymentScriptData ArmDeploymentScriptData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string kind = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity ArmDeploymentScriptManagedIdentity(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType? identityType = default(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch ArmDeploymentScriptPatch(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) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackData ArmDeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfContent ArmDeploymentWhatIfContent(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } @@ -1214,6 +1217,7 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.DecompiledFileDefinition DecompiledFileDefinition(string path = null, string contents = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult DecompileOperationSuccessResult(System.Collections.Generic.IEnumerable files = null, string entryPoint = null) { throw null; } public static Azure.ResourceManager.Resources.DeploymentStackData DeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } + public static Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult DeploymentStackValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties properties = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeploymentExtended(string provisioningState = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentType? deploymentType = default(Azure.ResourceManager.Resources.Models.ErrorDeploymentType?), string deploymentName = null) { throw null; } public static Azure.ResourceManager.Resources.JitRequestData JitRequestData(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 applicationResourceId = null, System.Guid? publisherTenantId = default(System.Guid?), System.Collections.Generic.IEnumerable jitAuthorizationPolicies = null, Azure.ResourceManager.Resources.Models.JitSchedulingPolicy jitSchedulingPolicy = null, Azure.ResourceManager.Resources.Models.ResourcesProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.ResourcesProvisioningState?), Azure.ResourceManager.Resources.Models.JitRequestState? jitRequestState = default(Azure.ResourceManager.Resources.Models.JitRequestState?), Azure.ResourceManager.Resources.Models.ArmApplicationDetails createdBy = null, Azure.ResourceManager.Resources.Models.ArmApplicationDetails updatedBy = null) { throw null; } @@ -1461,6 +1465,17 @@ public DeploymentStacksTemplateLink() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DeploymentStackTemplateDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DeploymentStackTemplateDefinition() { } + public System.BinaryData Template { get { throw null; } } + public Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink TemplateLink { get { throw null; } } + Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DeploymentStackValidateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeploymentStackValidateProperties() { } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs similarity index 65% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs index 327e7aaf58780..8898261a3f5be 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs @@ -17,28 +17,28 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeploymentStacks method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetArmDeploymentStacks method from an instance of . /// - public partial class DeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ArmDeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deploymentStackClientDiagnostics; - private readonly DeploymentStacksRestOperations _deploymentStackRestClient; + private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; + private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; - /// Initializes a new instance of the class for mocking. - protected DeploymentStackCollection() + /// Initializes a new instance of the class for mocking. + protected ArmDeploymentStackCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", DeploymentStackResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeploymentStackResource.ResourceType, out string deploymentStackApiVersion); - _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); + _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ArmDeploymentStackResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ArmDeploymentStackResource.ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); + _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); } /// @@ -58,7 +58,7 @@ internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : ba /// /// /// Resource - /// + /// /// /// /// @@ -68,17 +68,17 @@ internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : ba /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -107,7 +107,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Resource - /// + /// /// /// /// @@ -117,17 +117,17 @@ public virtual async Task> CreateOrUpdateA /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -156,7 +156,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Resource - /// + /// /// /// /// @@ -164,18 +164,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -201,7 +201,7 @@ public virtual async Task> GetAsync(string dep /// /// /// Resource - /// + /// /// /// /// @@ -209,18 +209,18 @@ public virtual async Task> GetAsync(string dep /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -246,17 +246,17 @@ public virtual Response Get(string deploymentStackName, /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtCopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -276,17 +276,17 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtCopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -306,7 +306,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -318,11 +318,11 @@ public virtual async Task> ExistsAsync(string deploymentStackName { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -349,7 +349,7 @@ public virtual async Task> ExistsAsync(string deploymentStackName /// /// /// Resource - /// + /// /// /// /// @@ -361,11 +361,11 @@ public virtual Response Exists(string deploymentStackName, CancellationTok { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -392,7 +392,7 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// /// /// Resource - /// + /// /// /// /// @@ -400,18 +400,18 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -437,7 +437,7 @@ public virtual async Task> GetIfExists /// /// /// Resource - /// + /// /// /// /// @@ -445,18 +445,18 @@ public virtual async Task> GetIfExists /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -465,7 +465,7 @@ public virtual NullableResponse GetIfExists(string depl } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -475,7 +475,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs similarity index 95% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs index cf940624caec7..39cb0a4b947eb 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs @@ -17,16 +17,16 @@ namespace Azure.ResourceManager.Resources { - public partial class DeploymentStackData : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -224,19 +224,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStackData(document.RootElement, options); + return DeserializeArmDeploymentStackData(document.RootElement, options); } - internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -524,7 +524,7 @@ internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackData( + return new ArmDeploymentStackData( id, name, type, @@ -1054,9 +1054,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -1065,26 +1065,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{options.Format}' format."); } } - DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStackData(document.RootElement, options); + return DeserializeArmDeploymentStackData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs similarity index 91% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs index 732dcb34ef98c..34349fa7e1846 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing the DeploymentStack data model. + /// A class representing the ArmDeploymentStack data model. /// Deployment stack object. /// - public partial class DeploymentStackData : TrackedResourceData + public partial class ArmDeploymentStackData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,9 +51,9 @@ public partial class DeploymentStackData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public DeploymentStackData(AzureLocation location) : base(location) + public ArmDeploymentStackData(AzureLocation location) : base(location) { Parameters = new ChangeTrackingDictionary(); DetachedResources = new ChangeTrackingList(); @@ -62,7 +62,7 @@ public DeploymentStackData(AzureLocation location) : base(location) Resources = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -90,7 +90,7 @@ public DeploymentStackData(AzureLocation location) : base(location) /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// Keeps track of any properties unknown to the library. - internal DeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Error = error; Template = template; @@ -115,8 +115,8 @@ internal DeploymentStackData(ResourceIdentifier id, string name, ResourceType re _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentStackData() + /// Initializes a new instance of for deserialization. + internal ArmDeploymentStackData() { } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs new file mode 100644 index 0000000000000..2e805f382e98a --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Resources +{ + public partial class ArmDeploymentStackResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs similarity index 68% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs index 90f0580ab54ed..495c5cc033762 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.Resources { /// - /// A Class representing a DeploymentStack along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeploymentStackResource method. - /// Otherwise you can get one from its parent resource using the GetDeploymentStack method. + /// A Class representing an ArmDeploymentStack along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetArmDeploymentStackResource method. + /// Otherwise you can get one from its parent resource using the GetArmDeploymentStack method. /// - public partial class DeploymentStackResource : ArmResource + public partial class ArmDeploymentStackResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The scope. /// The deploymentStackName. public static ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) @@ -33,35 +33,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string scope, string d return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deploymentStackClientDiagnostics; - private readonly DeploymentStacksRestOperations _deploymentStackRestClient; - private readonly DeploymentStackData _data; + private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; + private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; + private readonly ArmDeploymentStackData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Resources/deploymentStacks"; - /// Initializes a new instance of the class for mocking. - protected DeploymentStackResource() + /// Initializes a new instance of the class for mocking. + protected ArmDeploymentStackResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeploymentStackResource(ArmClient client, DeploymentStackData data) : this(client, data.Id) + internal ArmDeploymentStackResource(ArmClient client, ArmDeploymentStackData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ArmDeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deploymentStackApiVersion); - _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); + _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); + _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -72,7 +72,7 @@ internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeploymentStackData Data + public virtual ArmDeploymentStackData Data { get { @@ -105,21 +105,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -145,21 +145,21 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Resource - /// + /// /// /// /// @@ -197,12 +197,12 @@ public virtual Response Get(CancellationToken cancellat /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); scope.Start(); try { - var response = await _deploymentStackRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = await _armDeploymentStackDeploymentStacksRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -231,7 +231,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// /// /// Resource - /// + /// /// /// /// @@ -243,12 +243,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); scope.Start(); try { - var response = _deploymentStackRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); - var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = _armDeploymentStackDeploymentStacksRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); + var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -277,7 +277,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// /// /// Resource - /// + /// /// /// /// @@ -285,16 +285,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); scope.Start(); try { - var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -323,7 +323,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Resource - /// + /// /// /// /// @@ -331,16 +331,16 @@ public virtual async Task> UpdateAsync(Wai /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); scope.Start(); try { - var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -353,7 +353,45 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } /// - /// Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager. + /// Exports the template used to create the Deployment stack. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate + /// + /// + /// Operation Id + /// DeploymentStacks_ExportTemplateAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) + { + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); + scope.Start(); + try + { + var response = await _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Exports the template used to create the Deployment stack. /// /// /// Request Path @@ -361,6 +399,44 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Operation Id + /// DeploymentStacks_ExportTemplateAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response ExportTemplate(CancellationToken cancellationToken = default) + { + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); + scope.Start(); + try + { + var response = _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Runs preflight validation on the specific scoped Deployment stack template to verify its acceptance to Azure Resource Manager. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate + /// + /// + /// Operation Id /// DeploymentStacks_ValidateStackAtScope /// /// @@ -369,7 +445,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Resource - /// + /// /// /// /// @@ -377,16 +453,16 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = await _deploymentStackRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -403,7 +479,7 @@ public virtual async Task> ValidateS /// /// /// Request Path - /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate /// /// /// Operation Id @@ -415,7 +491,7 @@ public virtual async Task> ValidateS /// /// /// Resource - /// + /// /// /// /// @@ -423,16 +499,16 @@ public virtual async Task> ValidateS /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual ArmOperation ValidateStack(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateStack(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = _deploymentStackRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -461,7 +537,7 @@ public virtual ArmOperation ValidateStack(WaitUnt /// /// /// Resource - /// + /// /// /// /// @@ -469,12 +545,12 @@ public virtual ArmOperation ValidateStack(WaitUnt /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); scope.Start(); try { @@ -483,8 +559,8 @@ public virtual async Task> AddTagAsync(string var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -518,7 +594,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Resource - /// + /// /// /// /// @@ -526,12 +602,12 @@ public virtual async Task> AddTagAsync(string /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); scope.Start(); try { @@ -540,8 +616,8 @@ public virtual Response AddTag(string key, string value var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -575,18 +651,18 @@ public virtual Response AddTag(string key, string value /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); scope.Start(); try { @@ -596,8 +672,8 @@ public virtual async Task> SetTagsAsync(IDicti var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -631,18 +707,18 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); scope.Start(); try { @@ -652,8 +728,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -707,8 +783,8 @@ public virtual async Task> RemoveTagAsync(stri var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -742,18 +818,18 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -762,8 +838,8 @@ public virtual Response RemoveTag(string key, Cancellat var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index 97451739f2bff..74ea72dc24f48 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -851,6 +851,16 @@ public static DecompiledFileDefinition DecompiledFileDefinition(string path = nu } /// Initializes a new instance of . + /// Initializes a new instance of . + /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// The URI of the template. Use either the templateLink property or the template property, but not both. + /// A new instance for mocking. + public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(BinaryData template = null, DeploymentStacksTemplateLink templateLink = null) + { + return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -877,8 +887,8 @@ public static DecompiledFileDefinition DecompiledFileDefinition(string path = nu /// The resourceId of the deployment resource created by the deployment stack. /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. - /// A new instance for mocking. - public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + /// A new instance for mocking. + public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) { tags ??= new Dictionary(); parameters ??= new Dictionary(); @@ -887,7 +897,7 @@ public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = nu failedResources ??= new List(); resources ??= new List(); - return new DeploymentStackData( + return new ArmDeploymentStackData( id, name, resourceType, diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs deleted file mode 100644 index fcb29ed47817c..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Resources -{ - public partial class DeploymentStackResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs index b9f0ee8fd5acc..6bb7ab5bbb7ca 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs @@ -37,12 +37,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of DeploymentStackResources in the ArmClient. + /// Gets a collection of ArmDeploymentStackResources in the ArmClient. /// The scope that the resource will apply against. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public virtual DeploymentStackCollection GetDeploymentStacks(ResourceIdentifier scope) + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks(ResourceIdentifier scope) { - return new DeploymentStackCollection(Client, scope); + return new ArmDeploymentStackCollection(Client, scope); } /// @@ -62,7 +62,7 @@ public virtual DeploymentStackCollection GetDeploymentStacks(ResourceIdentifier /// /// /// Resource - /// + /// /// /// /// @@ -72,9 +72,9 @@ public virtual DeploymentStackCollection GetDeploymentStacks(ResourceIdentifier /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeploymentStackAsync(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetArmDeploymentStackAsync(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetDeploymentStacks(scope).GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetArmDeploymentStacks(scope).GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -94,7 +94,7 @@ public virtual async Task> GetDeploymentStackA /// /// /// Resource - /// + /// /// /// /// @@ -104,9 +104,9 @@ public virtual async Task> GetDeploymentStackA /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeploymentStack(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetArmDeploymentStack(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) { - return GetDeploymentStacks(scope).Get(deploymentStackName, cancellationToken); + return GetArmDeploymentStacks(scope).Get(deploymentStackName, cancellationToken); } /// @@ -206,15 +206,15 @@ public virtual JitRequestResource GetJitRequestResource(ResourceIdentifier id) } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeploymentStackResource GetDeploymentStackResource(ResourceIdentifier id) + /// Returns a object. + public virtual ArmDeploymentStackResource GetArmDeploymentStackResource(ResourceIdentifier id) { - DeploymentStackResource.ValidateResourceId(id); - return new DeploymentStackResource(Client, id); + ArmDeploymentStackResource.ValidateResourceId(id); + return new ArmDeploymentStackResource(Client, id); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index d2c0dfd1de266..d6238becb42af 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -44,21 +44,21 @@ private static MockableResourcesTenantResource GetMockableResourcesTenantResourc } /// - /// Gets a collection of DeploymentStackResources in the ArmClient. + /// Gets a collection of ArmDeploymentStackResources in the ArmClient. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The scope that the resource will apply against. /// is null. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public static DeploymentStackCollection GetDeploymentStacks(this ArmClient client, ResourceIdentifier scope) + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ArmClient client, ResourceIdentifier scope) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableResourcesArmClient(client).GetDeploymentStacks(scope); + return GetMockableResourcesArmClient(client).GetArmDeploymentStacks(scope); } /// @@ -78,12 +78,12 @@ public static DeploymentStackCollection GetDeploymentStacks(this ArmClient clien /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -93,11 +93,11 @@ public static DeploymentStackCollection GetDeploymentStacks(this ArmClient clien /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeploymentStackAsync(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetArmDeploymentStackAsync(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return await GetMockableResourcesArmClient(client).GetDeploymentStackAsync(scope, deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesArmClient(client).GetArmDeploymentStackAsync(scope, deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -117,12 +117,12 @@ public static async Task> GetDeploymentStackAs /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -132,11 +132,11 @@ public static async Task> GetDeploymentStackAs /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeploymentStack(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetArmDeploymentStack(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableResourcesArmClient(client).GetDeploymentStack(scope, deploymentStackName, cancellationToken); + return GetMockableResourcesArmClient(client).GetArmDeploymentStack(scope, deploymentStackName, cancellationToken); } /// @@ -292,22 +292,22 @@ public static JitRequestResource GetJitRequestResource(this ArmClient client, Re } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeploymentStackResource GetDeploymentStackResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ArmDeploymentStackResource GetArmDeploymentStackResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableResourcesArmClient(client).GetDeploymentStackResource(id); + return GetMockableResourcesArmClient(client).GetArmDeploymentStackResource(id); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs new file mode 100644 index 0000000000000..470c7cbd2de4e --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Resources +{ + internal class ArmDeploymentStackOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ArmDeploymentStackOperationSource(ArmClient client) + { + _client = client; + } + + ArmDeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + return new ArmDeploymentStackResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + return new ArmDeploymentStackResource(_client, data); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs deleted file mode 100644 index 24d61a2df9aa0..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.Resources -{ - internal class DeploymentStackOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeploymentStackOperationSource(ArmClient client) - { - _client = client; - } - - DeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); - return new DeploymentStackResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); - return new DeploymentStackResource(_client, data); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs index 205eeb12438fe..1d3084855711c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs @@ -81,7 +81,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,10 +93,10 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeploymentStackData.DeserializeDeploymentStackData(item, options)); + array.Add(ArmDeploymentStackData.DeserializeArmDeploymentStackData(item, options)); } value = array; continue; @@ -112,7 +112,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs index 8b6ba6dd33ca0..b32693cf5cf90 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs @@ -48,14 +48,14 @@ internal partial class DeploymentStackListResult /// Initializes a new instance of . internal DeploymentStackListResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// An array of Deployment stacks. /// The URL to use for getting the next set of results. /// Keeps track of any properties unknown to the library. - internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal DeploymentStackListResult(IReadOnlyList value, str } /// An array of Deployment stacks. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The URL to use for getting the next set of results. public string NextLink { get; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs new file mode 100644 index 0000000000000..86e22ee4f18ac --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Resources.Models +{ + public partial class DeploymentStackTemplateDefinition : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Template)) + { + writer.WritePropertyName("template"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Template); +#else + using (JsonDocument document = JsonDocument.Parse(Template)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(TemplateLink)) + { + writer.WritePropertyName("templateLink"u8); + writer.WriteObjectValue(TemplateLink, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + DeploymentStackTemplateDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentStackTemplateDefinition(document.RootElement, options); + } + + internal static DeploymentStackTemplateDefinition DeserializeDeploymentStackTemplateDefinition(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData template = default; + DeploymentStacksTemplateLink templateLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("template"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + template = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("templateLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Template), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" template: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Template)) + { + builder.Append(" template: "); + builder.AppendLine($"'{Template.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TemplateLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" templateLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TemplateLink)) + { + builder.Append(" templateLink: "); + BicepSerializationHelpers.AppendChildObject(builder, TemplateLink, options, 2, false, " templateLink: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support writing '{options.Format}' format."); + } + } + + DeploymentStackTemplateDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDeploymentStackTemplateDefinition(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs new file mode 100644 index 0000000000000..df86a78d43da0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Export Template specific properties of the Deployment stack. + public partial class DeploymentStackTemplateDefinition + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DeploymentStackTemplateDefinition() + { + } + + /// Initializes a new instance of . + /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// The URI of the template. Use either the templateLink property or the template property, but not both. + /// Keeps track of any properties unknown to the library. + internal DeploymentStackTemplateDefinition(BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary serializedAdditionalRawData) + { + Template = template; + TemplateLink = templateLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("template")] + public BinaryData Template { get; } + /// The URI of the template. Use either the templateLink property or the template property, but not both. + [WirePath("templateLink")] + public DeploymentStacksTemplateLink TemplateLink { get; } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs index 1ba32e2adadc6..4944bacbe81e1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -36,7 +36,7 @@ public DeploymentStacksRestOperations(HttpPipeline pipeline, string applicationI _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) + internal RequestUriBuilder CreateExportTemplateAtScopeRequestUri(string scope, string deploymentStackName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -49,7 +49,7 @@ internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, st return uri; } - internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) + internal Core.HttpMessage CreateExportTemplateAtScopeRequest(string scope, string deploymentStackName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,6 +64,92 @@ internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Exports the template used to create the Deployment stack. + /// The resource scope. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ExportTemplateAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var message = CreateExportTemplateAtScopeRequest(scope, deploymentStackName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackTemplateDefinition value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DeploymentStackTemplateDefinition.DeserializeDeploymentStackTemplateDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Exports the template used to create the Deployment stack. + /// The resource scope. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ExportTemplateAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(scope, nameof(scope)); + Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); + + using var message = CreateExportTemplateAtScopeRequest(scope, deploymentStackName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentStackTemplateDefinition value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DeploymentStackTemplateDefinition.DeserializeDeploymentStackTemplateDefinition(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/", false); + uri.AppendPath(scope, false); + uri.AppendPath("/providers/Microsoft.Resources/deploymentStacks/", false); + uri.AppendPath(deploymentStackName, true); + uri.AppendPath("/validate", false); + 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, ModelSerializationExtensions.WireOptions); @@ -79,7 +165,7 @@ internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -105,7 +191,7 @@ public async Task ValidateStackAtScopeAsync(string scope, string deplo /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response ValidateStackAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public Response ValidateStackAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -200,7 +286,7 @@ public Response ListAtCope(string scope, Cancellation } } - internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) + internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -212,7 +298,7 @@ internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, s return uri; } - internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) + internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -241,7 +327,7 @@ internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, strin /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -266,7 +352,7 @@ public async Task CreateOrUpdateAtScopeAsync(string scope, string depl /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -320,7 +406,7 @@ internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymen /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -331,13 +417,13 @@ public async Task> GetAtScopeAsync(string scope, s { case 200: { - DeploymentStackData value = default; + ArmDeploymentStackData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeploymentStackData)null, message.Response); + return Response.FromValue((ArmDeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -349,7 +435,7 @@ public async Task> GetAtScopeAsync(string scope, s /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -360,13 +446,13 @@ public Response GetAtScope(string scope, string deploymentS { case 200: { - DeploymentStackData value = default; + ArmDeploymentStackData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeploymentStackData)null, message.Response); + return Response.FromValue((ArmDeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 02926d8c70989..9c37be662d9a7 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -28,23 +28,19 @@ enable-bicep-serialization: true rename-mapping: DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition + DeploymentStack: ArmDeploymentStack patch-initializer-customization: ArmDeploymentContent: Properties: 'new ArmDeploymentProperties(current.Properties.Mode.HasValue ? current.Properties.Mode.Value : ArmDeploymentMode.Incremental)' request-path-to-parent: - #/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate: /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} - #/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} # setting these to the same parent will automatically merge these operations /providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName} /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} - #/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: /{scope}/providers/Microsoft.Resources/deploymentStacks - #/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: /{scope}/providers/Microsoft.Resources/deploymentStacks - #/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: /{scope}/providers/Microsoft.Resources/deploymentStacks request-path-to-scope-resource-types: /{scope}/providers/Microsoft.Resources/deployments/{deploymentName}: - subscriptions @@ -420,7 +416,7 @@ directive: } } }; - $['/{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate'] = { + $['/{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate'] = { "post": { "tags": [ "DeploymentStacks" From 61c4587abaf4807e1853ae8e3dc95833c4bcb29e Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 5 Jun 2024 11:36:12 +0800 Subject: [PATCH 03/19] Update --- .../Generated/ArmDeploymentStackCollection.cs | 12 +++++----- .../DeploymentStacksRestOperations.cs | 24 +++++++++---------- .../src/autorest.md | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs index 8898261a3f5be..d14c4b327aec4 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs @@ -238,7 +238,7 @@ public virtual Response Get(string deploymentStackNa /// /// /// Operation Id - /// DeploymentStacks_ListAtCope + /// DeploymentStacks_ListAtScope /// /// /// Default Api Version @@ -254,8 +254,8 @@ public virtual Response Get(string deploymentStackNa /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); + HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -268,7 +268,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Operation Id - /// DeploymentStacks_ListAtCope + /// DeploymentStacks_ListAtScope /// /// /// Default Api Version @@ -284,8 +284,8 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtCopeNextPageRequest(nextLink, Id); + HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs index 4944bacbe81e1..cfb34097d3b8d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -210,7 +210,7 @@ public Response ValidateStackAtScope(string scope, string deploymentStackName, A } } - internal RequestUriBuilder CreateListAtCopeRequestUri(string scope) + internal RequestUriBuilder CreateListAtScopeRequestUri(string scope) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -221,7 +221,7 @@ internal RequestUriBuilder CreateListAtCopeRequestUri(string scope) return uri; } - internal Core.HttpMessage CreateListAtCopeRequest(string scope) + internal Core.HttpMessage CreateListAtScopeRequest(string scope) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -242,11 +242,11 @@ internal Core.HttpMessage CreateListAtCopeRequest(string scope) /// The resource scope. /// The cancellation token to use. /// is null. - public async Task> ListAtCopeAsync(string scope, CancellationToken cancellationToken = default) + public async Task> ListAtScopeAsync(string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); - using var message = CreateListAtCopeRequest(scope); + using var message = CreateListAtScopeRequest(scope); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -266,11 +266,11 @@ public async Task> ListAtCopeAsync(string sc /// The resource scope. /// The cancellation token to use. /// is null. - public Response ListAtCope(string scope, CancellationToken cancellationToken = default) + public Response ListAtScope(string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); - using var message = CreateListAtCopeRequest(scope); + using var message = CreateListAtScopeRequest(scope); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -576,7 +576,7 @@ public Response DeleteAtScope(string scope, string deploymentStackName, Unmanage } } - internal RequestUriBuilder CreateListAtCopeNextPageRequestUri(string nextLink, string scope) + internal RequestUriBuilder CreateListAtScopeNextPageRequestUri(string nextLink, string scope) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -584,7 +584,7 @@ internal RequestUriBuilder CreateListAtCopeNextPageRequestUri(string nextLink, s return uri; } - internal Core.HttpMessage CreateListAtCopeNextPageRequest(string nextLink, string scope) + internal Core.HttpMessage CreateListAtScopeNextPageRequest(string nextLink, string scope) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -603,12 +603,12 @@ internal Core.HttpMessage CreateListAtCopeNextPageRequest(string nextLink, strin /// The resource scope. /// The cancellation token to use. /// or is null. - public async Task> ListAtCopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) + public async Task> ListAtScopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(scope, nameof(scope)); - using var message = CreateListAtCopeNextPageRequest(nextLink, scope); + using var message = CreateListAtScopeNextPageRequest(nextLink, scope); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -629,12 +629,12 @@ public async Task> ListAtCopeNextPageAsync(s /// The resource scope. /// The cancellation token to use. /// or is null. - public Response ListAtCopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) + public Response ListAtScopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(scope, nameof(scope)); - using var message = CreateListAtCopeNextPageRequest(nextLink, scope); + using var message = CreateListAtScopeNextPageRequest(nextLink, scope); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 9c37be662d9a7..b19c8d51274f4 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -487,7 +487,7 @@ directive: "tags": [ "DeploymentStacks" ], - "operationId": "DeploymentStacks_ListAtCope", + "operationId": "DeploymentStacks_ListAtScope", "description": "Lists all the Deployment stacks within the specified scope.", "parameters": [ { From 0dc44d89a1c212d5340b881ea446be31d471cf7b Mon Sep 17 00:00:00 2001 From: Dante Dalla Gasperina Date: Wed, 5 Jun 2024 09:44:41 -0400 Subject: [PATCH 04/19] started test writing. --- .../tests/ResourcesTestBase.cs | 17 +++ .../DeploymentStackCollectionTests.cs | 102 ++++++++++++++++++ .../DeploymentStackOperationsTests.cs | 35 ++++++ 3 files changed, 154 insertions(+) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index c2223f1038058..3952c8b6b8c7f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -137,6 +137,23 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem Location = location }; + protected static DeploymentStackData CreateDeploymentStackDataWithEmptyTemplate(string stackId, AzureLocation location) { + var data = new DeploymentStackData() { + Template = BinaryData.FromObjectAsJson(new JsonObject()), + DenySettings = new DenySettings() { + Mode = DenySettingsMode.None, + }, + ActionOnUnmanage = new ActionOnUnmanage() { + Resources = DeploymentStacksDeleteDetachEnum.Detach, + ResourceGroups = DeploymentStacksDeleteDetachEnum.Detach, + ManagementGroups = DeploymentStacksDeleteDetachEnum.Detach + }, + BypassStackOutOfSyncError = false + }; + + return data; + } + private static GenericResourceData ConstructGenericUserAssignedIdentities() { var userAssignedIdentities = new GenericResourceData(AzureLocation.WestUS2); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs new file mode 100644 index 0000000000000..4ed0724617613 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Resources.Tests +{ + public class DeploymentStackCollectionTests : ResourcesTestBase + { + public DeploymentStackCollectionTests(bool isAsync) + : base(isAsync)//, RecordedTestMode.Record + { + } + + [TestCase] + [RecordedTest] + public async Task CreateOrUpdate() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); + var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; + var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); + DeploymentStackResource deploymentStack = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + + Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); + } + + [TestCase] + [RecordedTest] + public async Task List() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); + var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; + var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); + _ = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + + var deploymentStacks = Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)); + int count = 0; + await foreach (var deploymentStack in deploymentStacks) + { + count++; + } + Assert.AreEqual(count, 1); + } + + [TestCase] + [RecordedTest] + public async Task Get() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); + var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; + var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); + var deploymentStack = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + + var deploymentStackGet = Client.GetDeploymentStack(new ResourceIdentifier(subscription.Id), deploymentStackName); + AssertValidDeploymentStack(deploymentStack, deploymentStackGet); + } + + [TestCase] + [RecordedTest] + public async Task Export() + { + // SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + // string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); + // var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; + // var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); + // var deploymentStackCollection = Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)); + + // var _ = await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData); + // var deploymentStackTemplate = deploymentStackCollection.Get() + + // var deploymentStackGet = Client.GetDeploymentStack(new ResourceIdentifier(subscription.Id), deploymentStackName); + // AssertValidDeploymentStack(deploymentStack, deploymentStackGet); + } + + + private static void AssertValidDeploymentStack(DeploymentStackResource model, DeploymentStackResource getResult) + { + Assert.AreEqual(model.Data.Name, getResult.Data.Name); + Assert.AreEqual(model.Data.Id, getResult.Data.Id); + Assert.AreEqual(model.Data.ResourceType, getResult.Data.ResourceType); + Assert.AreEqual(model.Data.Location, getResult.Data.Location); + Assert.AreEqual(model.Data.Tags, getResult.Data.Tags); + + Assert.AreEqual(model.Data.ActionOnUnmanage.Resources, getResult.Data.ActionOnUnmanage.Resources); + Assert.AreEqual(model.Data.ActionOnUnmanage.ResourceGroups, getResult.Data.ActionOnUnmanage.ResourceGroups); + Assert.AreEqual(model.Data.ActionOnUnmanage.ManagementGroups, getResult.Data.ActionOnUnmanage.ManagementGroups); + Assert.AreEqual(model.Data.DenySettings.Mode, getResult.Data.DenySettings.Mode); + Assert.AreEqual(model.Data.DenySettings.ApplyToChildScopes, getResult.Data.DenySettings.ApplyToChildScopes); + Assert.AreEqual(model.Data.DenySettings.ExcludedPrincipals, getResult.Data.DenySettings.ExcludedPrincipals); + Assert.AreEqual(model.Data.DenySettings.ExcludedActions, getResult.Data.DenySettings.ExcludedActions); + Assert.AreEqual(model.Data.BypassStackOutOfSyncError, getResult.Data.BypassStackOutOfSyncError); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs new file mode 100644 index 0000000000000..ea5aa2e10142a --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagementGroups; +using Azure.ResourceManager.Resources.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Resources.Tests +{ + public class DeploymentStackOperationsTests : ResourcesTestBase + { + public DeploymentStackOperationsTests(bool isAsync) + : base(isAsync)//, RecordedTestMode.Record + { + } + + [TestCase] + [RecordedTest] + public async Task Delete() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); + var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; + var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); + DeploymentStackResource deploymentStack = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + await deploymentStack.DeleteAsync(WaitUntil.Completed); + + var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); + Assert.AreEqual(404, ex.Status); + } + } +} From 21df1819a793af376083556aa732ddf436a8e580 Mon Sep 17 00:00:00 2001 From: Dante Dalla Gasperina Date: Wed, 5 Jun 2024 19:42:34 -0400 Subject: [PATCH 05/19] Add initial tests for deployment stacks sdk. --- .../tests/ResourcesTestBase.cs | 53 ++++++++++++++----- .../DeploymentStackCollectionTests.cs | 50 +++++++---------- .../DeploymentStackOperationsTests.cs | 27 ++++++++-- .../DeploymentTemplates/rg-template.json | 22 ++++++++ 4 files changed, 104 insertions(+), 48 deletions(-) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 3952c8b6b8c7f..6f8d27fd96486 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -12,8 +12,10 @@ using Azure.ResourceManager.TestFramework; using Azure.ResourceManager.Resources.Models; using NUnit.Framework; +using System.Collections.Generic; using JsonObject = System.Collections.Generic.Dictionary; using System.Security.Policy; +using System.Text; namespace Azure.ResourceManager.Resources.Tests { @@ -137,20 +139,47 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem Location = location }; - protected static DeploymentStackData CreateDeploymentStackDataWithEmptyTemplate(string stackId, AzureLocation location) { - var data = new DeploymentStackData() { - Template = BinaryData.FromObjectAsJson(new JsonObject()), - DenySettings = new DenySettings() { - Mode = DenySettingsMode.None, - }, - ActionOnUnmanage = new ActionOnUnmanage() { - Resources = DeploymentStacksDeleteDetachEnum.Detach, - ResourceGroups = DeploymentStacksDeleteDetachEnum.Detach, - ManagementGroups = DeploymentStacksDeleteDetachEnum.Detach - }, - BypassStackOutOfSyncError = false + protected static ArmDeploymentStackData CreateDeploymentStackDataWithEmptyTemplate(string stackId, AzureLocation location) + { + var data = new ArmDeploymentStackData(location); + + data.Template = BinaryData.FromString("{}"); + + data.DenySettings = new DenySettings(DenySettingsMode.None); + + data.ActionOnUnmanage = new ActionOnUnmanage() + { + Resources = DeploymentStacksDeleteDetachEnum.Detach, + ResourceGroups = DeploymentStacksDeleteDetachEnum.Detach, + ManagementGroups = DeploymentStacksDeleteDetachEnum.Detach + }; + + data.BypassStackOutOfSyncError = false; + + return data; + } + + protected static ArmDeploymentStackData CreateDeploymentStackDataWithTemplate(AzureLocation location) { + var data = new ArmDeploymentStackData(location); + + data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + "Scenario", + "DeploymentTemplates", + $"rg-template.json"))); + + data.DenySettings = new DenySettings(DenySettingsMode.None); + + data.ActionOnUnmanage = new ActionOnUnmanage() { + Resources = DeploymentStacksDeleteDetachEnum.Detach, + ResourceGroups = DeploymentStacksDeleteDetachEnum.Detach, + ManagementGroups = DeploymentStacksDeleteDetachEnum.Detach }; + data.BypassStackOutOfSyncError = false; + + //data.Parameters.Add("rgname", new DeploymentParameter { DeploymentParameterType = "string", Value = BinaryData.FromString("\"stacksTest4321\"") }); + return data; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index 4ed0724617613..12a1a93fede33 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -22,12 +22,13 @@ public DeploymentStackCollectionTests(bool isAsync) public async Task CreateOrUpdate() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); - var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; - var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); - DeploymentStackResource deploymentStack = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-CreateOrUpdate-"); + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } [TestCase] @@ -35,17 +36,18 @@ public async Task CreateOrUpdate() public async Task List() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); - var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; - var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); - _ = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-List-"); + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)); + var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); int count = 0; await foreach (var deploymentStack in deploymentStacks) { count++; + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } + Assert.AreEqual(count, 1); } @@ -54,34 +56,18 @@ public async Task List() public async Task Get() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); - var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; - var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); - var deploymentStack = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Get-"); + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = Client.GetDeploymentStack(new ResourceIdentifier(subscription.Id), deploymentStackName); - AssertValidDeploymentStack(deploymentStack, deploymentStackGet); - } + var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(subscription.Id), deploymentStackName)).Value; - [TestCase] - [RecordedTest] - public async Task Export() - { - // SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - // string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); - // var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; - // var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); - // var deploymentStackCollection = Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)); - - // var _ = await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData); - // var deploymentStackTemplate = deploymentStackCollection.Get() + AssertValidDeploymentStack(deploymentStack, deploymentStackGet); - // var deploymentStackGet = Client.GetDeploymentStack(new ResourceIdentifier(subscription.Id), deploymentStackName); - // AssertValidDeploymentStack(deploymentStack, deploymentStackGet); + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } - - private static void AssertValidDeploymentStack(DeploymentStackResource model, DeploymentStackResource getResult) + private static void AssertValidDeploymentStack(ArmDeploymentStackResource model, ArmDeploymentStackResource getResult) { Assert.AreEqual(model.Data.Name, getResult.Data.Name); Assert.AreEqual(model.Data.Id, getResult.Data.Id); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index ea5aa2e10142a..9011f55aa8ad9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -7,6 +7,7 @@ using Azure.ResourceManager.ManagementGroups; using Azure.ResourceManager.Resources.Models; using NUnit.Framework; +using System; namespace Azure.ResourceManager.Resources.Tests { @@ -22,14 +23,32 @@ public DeploymentStackOperationsTests(bool isAsync) public async Task Delete() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-C-"); - var stackId = "/subscription/" + subscription.Id + "/Microsoft.Resources/deploymentStacks/" + deploymentStackName; - var deploymentStackData = CreateDeploymentStackDataWithEmptyTemplate(stackId, "westus"); - DeploymentStackResource deploymentStack = (await Client.GetDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Delete-"); + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); Assert.AreEqual(404, ex.Status); } + + [TestCase] + [RecordedTest] + public async Task Export() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Export-"); + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); + + ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; + Assert.IsNotNull(deploymentStackTemplate); + + // TODO: Output is off by a little and may be how the template is being read. + //Assert.AreEqual(deploymentStackTemplate.Template, deploymentStackData.Template); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json new file mode 100644 index 0000000000000..5d8664fa7e3b9 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "rgname": { + "type": "string", + "defaultValue": "testStacksSDK321" + }, + "location": { + "type": "string", + "defaultValue": "[deployment().location]" + } + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2021-04-01", + "name": "[parameters('rgname')]", + "location": "[parameters('location')]" + } + ] + } \ No newline at end of file From 9db8dc083b7d1cf78233210e3cdc9020fee176e6 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 6 Jun 2024 22:49:03 +0800 Subject: [PATCH 06/19] update --- ...ure.ResourceManager.Resources.netstandard2.0.cs | 2 +- .../Models/DeploymentParameter.Serialization.cs | 14 +++++++------- .../src/Generated/Models/DeploymentParameter.cs | 8 ++++---- .../src/autorest.md | 1 + 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index 3878b409be211..c35b7f96b1672 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -1386,7 +1386,7 @@ public DenySettings(Azure.ResourceManager.Resources.Models.DenySettingsMode mode public partial class DeploymentParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeploymentParameter() { } - public string DeploymentParameterType { get { throw null; } set { } } + public string DeploymentType { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.KeyVaultParameterReference Reference { get { throw null; } set { } } public System.BinaryData Value { get { throw null; } set { } } Azure.ResourceManager.Resources.Models.DeploymentParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs index 2042c0e1d26c6..c63792a67059b 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs @@ -39,10 +39,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } #endif } - if (Optional.IsDefined(DeploymentParameterType)) + if (Optional.IsDefined(DeploymentType)) { writer.WritePropertyName("type"u8); - writer.WriteStringValue(DeploymentParameterType); + writer.WriteStringValue(DeploymentType); } if (Optional.IsDefined(Reference)) { @@ -152,7 +152,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentParameterType), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentType), out propertyOverride); if (hasPropertyOverride) { builder.Append(" type: "); @@ -160,17 +160,17 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - if (Optional.IsDefined(DeploymentParameterType)) + if (Optional.IsDefined(DeploymentType)) { builder.Append(" type: "); - if (DeploymentParameterType.Contains(Environment.NewLine)) + if (DeploymentType.Contains(Environment.NewLine)) { builder.AppendLine("'''"); - builder.AppendLine($"{DeploymentParameterType}'''"); + builder.AppendLine($"{DeploymentType}'''"); } else { - builder.AppendLine($"'{DeploymentParameterType}'"); + builder.AppendLine($"'{DeploymentType}'"); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs index e810c066b72f0..d4e5ea6a561d0 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs @@ -52,13 +52,13 @@ public DeploymentParameter() /// Initializes a new instance of . /// Input value to the parameter. - /// Type of the value. + /// Type of the value. /// Azure Key Vault parameter reference. /// Keeps track of any properties unknown to the library. - internal DeploymentParameter(BinaryData value, string deploymentParameterType, KeyVaultParameterReference reference, IDictionary serializedAdditionalRawData) + internal DeploymentParameter(BinaryData value, string deploymentType, KeyVaultParameterReference reference, IDictionary serializedAdditionalRawData) { Value = value; - DeploymentParameterType = deploymentParameterType; + DeploymentType = deploymentType; Reference = reference; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,7 +97,7 @@ internal DeploymentParameter(BinaryData value, string deploymentParameterType, K public BinaryData Value { get; set; } /// Type of the value. [WirePath("type")] - public string DeploymentParameterType { get; set; } + public string DeploymentType { get; set; } /// Azure Key Vault parameter reference. [WirePath("reference")] public KeyVaultParameterReference Reference { get; set; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index b19c8d51274f4..7a4b10bd036db 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -29,6 +29,7 @@ rename-mapping: DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition DeploymentStack: ArmDeploymentStack + DeploymentParameter.type: DeploymentType patch-initializer-customization: ArmDeploymentContent: From 2f351b365cc1ca4626c87d7b8eb3df476b8ae800 Mon Sep 17 00:00:00 2001 From: Dante Dalla Gasperina Date: Thu, 6 Jun 2024 16:50:10 -0400 Subject: [PATCH 07/19] working on tests --- ...esourceManager.Resources.netstandard2.0.cs | 2 +- .../src/autorest.md | 2 +- .../tests/ResourcesTestBase.cs | 48 +++++- .../DeploymentStackCollectionTests.cs | 152 ++++++++++++++++-- .../DeploymentStackOperationsTests.cs | 7 +- .../mg-stack-template.json | 16 ++ .../rg-stack-template.json | 24 +++ .../DeploymentTemplates/rg-template.json | 22 --- .../sub-stack-template.json | 22 +++ 9 files changed, 252 insertions(+), 43 deletions(-) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/mg-stack-template.json create mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-stack-template.json delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json create mode 100644 sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/sub-stack-template.json diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index c35b7f96b1672..8c5ff0f05e087 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -281,7 +281,7 @@ protected ArmDeploymentStackCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ArmDeploymentStackData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ArmDeploymentStackData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ArmDeploymentStackData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Resources.Models.ActionOnUnmanage ActionOnUnmanage { get { throw null; } set { } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 7a4b10bd036db..7766a717b12b4 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -29,7 +29,7 @@ rename-mapping: DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition DeploymentStack: ArmDeploymentStack - DeploymentParameter.type: DeploymentType + DeploymentParameter.type: DeploymentParameterType patch-initializer-customization: ArmDeploymentContent: diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 6f8d27fd96486..7fdbfcaad0561 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -16,6 +16,7 @@ using JsonObject = System.Collections.Generic.Dictionary; using System.Security.Policy; using System.Text; +using Newtonsoft.Json.Linq; namespace Azure.ResourceManager.Resources.Tests { @@ -139,11 +140,42 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem Location = location }; - protected static ArmDeploymentStackData CreateDeploymentStackDataWithEmptyTemplate(string stackId, AzureLocation location) + protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate() + { + var data = new ArmDeploymentStackData(AzureLocation.WestUS); + data.Location = null; + + data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + "Scenario", + "DeploymentTemplates", + $"rg-stack-template.json"))); + + data.DenySettings = new DenySettings(DenySettingsMode.None); + + data.ActionOnUnmanage = new ActionOnUnmanage() + { + Resources = DeploymentStacksDeleteDetachEnum.Detach, + ResourceGroups = DeploymentStacksDeleteDetachEnum.Detach, + ManagementGroups = DeploymentStacksDeleteDetachEnum.Detach + }; + + data.BypassStackOutOfSyncError = false; + + data.Parameters.Add("templateSpecName", new DeploymentParameter { Value = BinaryData.FromString("\"stacksTestTemplate4321\"") }); + + return data; + } + + protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { var data = new ArmDeploymentStackData(location); - data.Template = BinaryData.FromString("{}"); + data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + "Scenario", + "DeploymentTemplates", + $"sub-stack-template,json"))); data.DenySettings = new DenySettings(DenySettingsMode.None); @@ -156,21 +188,25 @@ protected static ArmDeploymentStackData CreateDeploymentStackDataWithEmptyTempla data.BypassStackOutOfSyncError = false; + data.Parameters.Add("rgName", new DeploymentParameter { Value = BinaryData.FromString("\"stacksTestRG4321\"") } ); + return data; } - protected static ArmDeploymentStackData CreateDeploymentStackDataWithTemplate(AzureLocation location) { + protected static ArmDeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) + { var data = new ArmDeploymentStackData(location); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Scenario", "DeploymentTemplates", - $"rg-template.json"))); + $"mg-stack-template.json"))); data.DenySettings = new DenySettings(DenySettingsMode.None); - data.ActionOnUnmanage = new ActionOnUnmanage() { + data.ActionOnUnmanage = new ActionOnUnmanage() + { Resources = DeploymentStacksDeleteDetachEnum.Detach, ResourceGroups = DeploymentStacksDeleteDetachEnum.Detach, ManagementGroups = DeploymentStacksDeleteDetachEnum.Detach @@ -178,7 +214,7 @@ protected static ArmDeploymentStackData CreateDeploymentStackDataWithTemplate(Az data.BypassStackOutOfSyncError = false; - //data.Parameters.Add("rgname", new DeploymentParameter { DeploymentParameterType = "string", Value = BinaryData.FromString("\"stacksTest4321\"") }); + data.Parameters.Add("message", new DeploymentParameter { Value = BinaryData.FromString("\"hello world\"") }); return data; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index 12a1a93fede33..0c21f5cca15a1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -2,9 +2,11 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; +using Azure.ResourceManager.ManagementGroups; using Azure.ResourceManager.Resources.Models; using NUnit.Framework; @@ -19,28 +21,61 @@ public DeploymentStackCollectionTests(bool isAsync) [TestCase] [RecordedTest] - public async Task CreateOrUpdate() + public async Task CreateOrUpdateRG() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-CreateOrUpdate-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + + string rgName = Recording.GenerateAssetName("testRg-1-"); + ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); + ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; + + string deploymentStackName = Recording.GenerateAssetName("deployStackExRG-CreateOrUpdate-"); + var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + await rg.DeleteAsync(WaitUntil.Completed); } [TestCase] [RecordedTest] - public async Task List() + public async Task GetRG() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-List-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); - _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); + string rgName = Recording.GenerateAssetName("testRg-1-"); + ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); + ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; + + string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Get-"); + var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); + var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(rg.Id), deploymentStackName)).Value; + + AssertValidDeploymentStack(deploymentStack, deploymentStackGet); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + await rg.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task ListRG() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string rgName = Recording.GenerateAssetName("testRg-1-"); + ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); + ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; + + string deploymentStackName = Recording.GenerateAssetName("deployStackRG-List-"); + var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); + _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -49,15 +84,34 @@ public async Task List() } Assert.AreEqual(count, 1); + await rg.DeleteAsync(WaitUntil.Completed); + } + + /* Sub Scoped Deployment Stack Tests */ + + [TestCase] + [RecordedTest] + public async Task CreateOrUpdateSub() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-CreateOrUpdate-"); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } [TestCase] [RecordedTest] - public async Task Get() + public async Task GetSub() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Get-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(subscription.Id), deploymentStackName)).Value; @@ -67,6 +121,82 @@ public async Task Get() await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } + [TestCase] + [RecordedTest] + public async Task ListSub() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-List-"); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); + _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); + int count = 0; + await foreach (var deploymentStack in deploymentStacks) + { + count++; + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } + + Assert.AreEqual(count, 1); + } + + /* MG Scoped Deployment Stack Tests */ + + [TestCase] + [RecordedTest] + public async Task CreateOrUpdateMG() + { + ManagementGroupResource managementGroup = Client.GetManagementGroupResource(ManagementGroupResource.CreateResourceIdentifier("StacksSDKTest")); + + string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-CreateOrUpdate-"); + var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } + + [TestCase] + [RecordedTest] + public async Task GetMG() + { + ManagementGroupResource managementGroup = Client.GetManagementGroupResource(ManagementGroupResource.CreateResourceIdentifier("StacksSDKTest")); + + string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Get-"); + var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(managementGroup.Id), deploymentStackName)).Value; + + AssertValidDeploymentStack(deploymentStack, deploymentStackGet); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } + + [TestCase] + [RecordedTest] + public async Task ListMG() + { + ManagementGroupResource managementGroup = Client.GetManagementGroupResource(ManagementGroupResource.CreateResourceIdentifier("StacksSDKTest")); + + string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-List-"); + var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); + _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)); + int count = 0; + await foreach (var deploymentStack in deploymentStacks) + { + count++; + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } + + Assert.AreEqual(count, 1); + } + private static void AssertValidDeploymentStack(ArmDeploymentStackResource model, ArmDeploymentStackResource getResult) { Assert.AreEqual(model.Data.Name, getResult.Data.Name); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index 9011f55aa8ad9..7e9a51e60905c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -8,6 +8,7 @@ using Azure.ResourceManager.Resources.Models; using NUnit.Framework; using System; +using System.Collections.Generic; namespace Azure.ResourceManager.Resources.Tests { @@ -23,8 +24,9 @@ public DeploymentStackOperationsTests(bool isAsync) public async Task Delete() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Delete-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); @@ -37,8 +39,9 @@ public async Task Delete() public async Task Export() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Export-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/mg-stack-template.json b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/mg-stack-template.json new file mode 100644 index 0000000000000..9103dd59aa005 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/mg-stack-template.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-08-01/managementGroupDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "message": { + "type": "string" + } + }, + "resources": [], + "outputs": { + "outputMessage": { + "type": "string", + "value": "[parameters('message')]" + } + } +} \ No newline at end of file diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-stack-template.json b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-stack-template.json new file mode 100644 index 0000000000000..e63064520aa14 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-stack-template.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "templateSpecName": { + "type": "string" + } + }, + "variables": { + "location": "[resourceGroup().location]" + }, + "resources": [ + { + "type": "Microsoft.Resources/templateSpecs", + "apiVersion": "2022-02-01", + "name": "[parameters('templateSpecName')]", + "location": "[variables('location')]", + "properties": { + "displayName": "[parameters('templateSpecName')]", + "description": "Template Spec for RG scoped Deployment Stack Test" + } + } + ] +} \ No newline at end of file diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json deleted file mode 100644 index 5d8664fa7e3b9..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/rg-template.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "rgname": { - "type": "string", - "defaultValue": "testStacksSDK321" - }, - "location": { - "type": "string", - "defaultValue": "[deployment().location]" - } - }, - "resources": [ - { - "type": "Microsoft.Resources/resourceGroups", - "apiVersion": "2021-04-01", - "name": "[parameters('rgname')]", - "location": "[parameters('location')]" - } - ] - } \ No newline at end of file diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/sub-stack-template.json b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/sub-stack-template.json new file mode 100644 index 0000000000000..41eea5f5e12c3 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentTemplates/sub-stack-template.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "rgname": { + "type": "string", + "defaultValue": "testStacksSDK321" + }, + "location": { + "type": "string", + "defaultValue": "[deployment().location]" + } + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2021-04-01", + "name": "[parameters('rgname')]", + "location": "[parameters('location')]" + } + ] +} \ No newline at end of file From e1a80db81349c1498351dda42bce092c8ccd41b3 Mon Sep 17 00:00:00 2001 From: Dante Dalla Gasperina Date: Fri, 7 Jun 2024 12:17:25 -0400 Subject: [PATCH 08/19] update tests --- .../tests/ResourcesTestBase.cs | 6 +- .../DeploymentStackCollectionTests.cs | 27 +++++- .../DeploymentStackOperationsTests.cs | 97 +++++++++++++++++-- 3 files changed, 114 insertions(+), 16 deletions(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 7fdbfcaad0561..2d2ea9ff33cc5 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -12,11 +12,7 @@ using Azure.ResourceManager.TestFramework; using Azure.ResourceManager.Resources.Models; using NUnit.Framework; -using System.Collections.Generic; using JsonObject = System.Collections.Generic.Dictionary; -using System.Security.Policy; -using System.Text; -using Newtonsoft.Json.Linq; namespace Azure.ResourceManager.Resources.Tests { @@ -175,7 +171,7 @@ protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Scenario", "DeploymentTemplates", - $"sub-stack-template,json"))); + $"sub-stack-template.json"))); data.DenySettings = new DenySettings(DenySettingsMode.None); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index 0c21f5cca15a1..cf5fe34c6c64d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.Collections.Generic; using System.Threading.Tasks; using Azure.Core; using Azure.Core.TestFramework; @@ -19,6 +17,8 @@ public DeploymentStackCollectionTests(bool isAsync) { } + /* RG Scoped Deployment Stack Tests */ + [TestCase] [RecordedTest] public async Task CreateOrUpdateRG() @@ -104,6 +104,21 @@ public async Task CreateOrUpdateSub() await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } + [TestCase] + [RecordedTest] + public async Task ValidateSub() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-CreateOrUpdate-"); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + + Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } + [TestCase] [RecordedTest] public async Task GetSub() @@ -129,17 +144,19 @@ public async Task ListSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-List-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var stack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); int count = 0; await foreach (var deploymentStack in deploymentStacks) { count++; - await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } - Assert.AreEqual(count, 1); + await stack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + + // There are more stacks in the sub than just the one created for the test: + Assert.GreaterOrEqual(count, 1); } /* MG Scoped Deployment Stack Tests */ diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index 7e9a51e60905c..719b2eed09c6f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -7,8 +7,6 @@ using Azure.ResourceManager.ManagementGroups; using Azure.ResourceManager.Resources.Models; using NUnit.Framework; -using System; -using System.Collections.Generic; namespace Azure.ResourceManager.Resources.Tests { @@ -19,14 +17,64 @@ public DeploymentStackOperationsTests(bool isAsync) { } + /* RG Scoped Deployment Stack Tests */ + [TestCase] [RecordedTest] - public async Task Delete() + public async Task DeleteRG() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Delete-"); + string rgName = Recording.GenerateAssetName("testRg-1-"); + ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); + ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; + + string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Delete-"); + var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + await deploymentStack.DeleteAsync(WaitUntil.Completed); + + var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); + Assert.AreEqual(404, ex.Status); + await rg.DeleteAsync(WaitUntil.Completed); + } + + [TestCase] + [RecordedTest] + public async Task ExportRG() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string rgName = Recording.GenerateAssetName("testRg-1-"); + ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); + ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; + + string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Export-"); + var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); + var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); + + ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; + Assert.IsNotNull(deploymentStackTemplate); + + // TODO: Output is off by a little and may be how the template is being read. + //Assert.AreEqual(deploymentStackTemplate.Template, deploymentStackData.Template); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + await rg.DeleteAsync(WaitUntil.Completed); + } + + /* Sub Scoped Deployment Stack Tests */ + + [TestCase] + [RecordedTest] + public async Task DeleteSub() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Delete-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); @@ -36,11 +84,11 @@ public async Task Delete() [TestCase] [RecordedTest] - public async Task Export() + public async Task ExportSub() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Export-"); + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Export-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); @@ -53,5 +101,42 @@ public async Task Export() await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } + + /* MG Scoped Deployment Stack Tests */ + + [TestCase] + [RecordedTest] + public async Task DeleteMG() + { + ManagementGroupResource managementGroup = Client.GetManagementGroupResource(ManagementGroupResource.CreateResourceIdentifier("StacksSDKTest")); + + string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Delete-"); + var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); + ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + await deploymentStack.DeleteAsync(WaitUntil.Completed); + + var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); + Assert.AreEqual(404, ex.Status); + } + + [TestCase] + [RecordedTest] + public async Task ExportMG() + { + ManagementGroupResource managementGroup = Client.GetManagementGroupResource(ManagementGroupResource.CreateResourceIdentifier("StacksSDKTest")); + + string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Export-"); + var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)); + + ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; + Assert.IsNotNull(deploymentStackTemplate); + + // TODO: Output is off by a little and may be how the template is being read. + //Assert.AreEqual(deploymentStackTemplate.Template, deploymentStackData.Template); + + await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + } } } From 5e83a390892eb1ae31c39d9659143b03847b1df4 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 7 Jun 2024 21:24:17 +0800 Subject: [PATCH 09/19] update code --- ...esourceManager.Resources.netstandard2.0.cs | 32 +- .../src/Custom/ArmDeploymentStackData.cs | 21 + .../Generated/ArmDeploymentStackCollection.cs | 5 +- .../ArmDeploymentStackData.Serialization.cs | 32 +- .../src/Generated/ArmDeploymentStackData.cs | 25 +- .../Generated/ArmDeploymentStackResource.cs | 3 +- .../src/Generated/ArmResourcesModelFactory.cs | 8 +- .../Extensions/MockableResourcesArmClient.cs | 75 ---- ...ockableResourcesManagementGroupResource.cs | 69 ++++ .../MockableResourcesResourceGroupResource.cs | 69 ++++ .../MockableResourcesSubscriptionResource.cs | 69 ++++ .../Extensions/ResourcesExtensions.cs | 375 +++++++++++++----- .../DeploymentParameter.Serialization.cs | 14 +- .../Generated/Models/DeploymentParameter.cs | 8 +- .../src/autorest.md | 4 + .../tests/ResourcesTestBase.cs | 7 +- .../DeploymentStackCollectionTests.cs | 11 +- 17 files changed, 600 insertions(+), 227 deletions(-) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index 8c5ff0f05e087..526f010c37ffc 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -283,7 +283,7 @@ protected ArmDeploymentStackCollection() { } } public partial class ArmDeploymentStackData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ArmDeploymentStackData(Azure.Core.AzureLocation location) { } + public ArmDeploymentStackData() { } public Azure.ResourceManager.Resources.Models.ActionOnUnmanage ActionOnUnmanage { get { throw null; } set { } } public bool? BypassStackOutOfSyncError { get { throw null; } set { } } public string CorrelationId { get { throw null; } } @@ -297,11 +297,13 @@ public ArmDeploymentStackData(Azure.Core.AzureLocation location) { } public System.TimeSpan? Duration { get { throw null; } } public Azure.ResponseError Error { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList FailedResources { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public System.BinaryData Outputs { get { throw null; } } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink ParametersLink { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? ProvisioningState { get { throw null; } } public System.Collections.Generic.IReadOnlyList Resources { get { throw null; } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.BinaryData Template { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink TemplateLink { get { throw null; } set { } } Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -433,10 +435,16 @@ public static partial class ResourcesExtensions public static Azure.ResourceManager.Resources.ArmDeploymentScriptCollection GetArmDeploymentScripts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetArmDeploymentScripts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetArmDeploymentScriptsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Resources.ArmDeploymentStackResource GetArmDeploymentStackResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier scope) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } public static Azure.Response GetJitRequest(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetJitRequestAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetJitRequestDefinitions(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -605,10 +613,7 @@ protected MockableResourcesArmClient() { } public virtual Azure.ResourceManager.Resources.ArmApplicationResource GetArmApplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentResource GetArmDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentScriptResource GetArmDeploymentScriptResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.Response GetArmDeploymentStack(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(Azure.Core.ResourceIdentifier scope, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentStackResource GetArmDeploymentStackResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(Azure.Core.ResourceIdentifier scope) { throw null; } public virtual Azure.ResourceManager.Resources.JitRequestResource GetJitRequestResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ScriptLogResource GetScriptLogResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.TemplateSpecResource GetTemplateSpecResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -620,6 +625,9 @@ protected MockableResourcesManagementGroupResource() { } public virtual Azure.Response GetArmDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetArmDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentCollection GetArmDeployments() { throw null; } + public virtual Azure.Response GetArmDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks() { throw null; } } public partial class MockableResourcesResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -636,6 +644,9 @@ protected MockableResourcesResourceGroupResource() { } public virtual Azure.Response GetArmDeploymentScript(string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetArmDeploymentScriptAsync(string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentScriptCollection GetArmDeploymentScripts() { throw null; } + public virtual Azure.Response GetArmDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks() { throw null; } public virtual Azure.Response GetJitRequest(string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetJitRequestAsync(string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.JitRequestCollection GetJitRequests() { throw null; } @@ -655,6 +666,9 @@ protected MockableResourcesSubscriptionResource() { } public virtual Azure.ResourceManager.Resources.ArmDeploymentCollection GetArmDeployments() { throw null; } public virtual Azure.Pageable GetArmDeploymentScripts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetArmDeploymentScriptsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetArmDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks() { throw null; } public virtual Azure.Pageable GetJitRequestDefinitions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetJitRequestDefinitionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetTemplateSpecs(Azure.ResourceManager.Resources.Models.TemplateSpecExpandKind? expand = default(Azure.ResourceManager.Resources.Models.TemplateSpecExpandKind?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1207,7 +1221,7 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.ArmDeploymentScriptData ArmDeploymentScriptData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string kind = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity ArmDeploymentScriptManagedIdentity(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType? identityType = default(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch ArmDeploymentScriptPatch(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) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackData ArmDeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } + public static Azure.ResourceManager.Resources.ArmDeploymentStackData ArmDeploymentStackData(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?), System.Collections.Generic.IDictionary tags = null, Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfContent ArmDeploymentWhatIfContent(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } @@ -1386,7 +1400,7 @@ public DenySettings(Azure.ResourceManager.Resources.Models.DenySettingsMode mode public partial class DeploymentParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DeploymentParameter() { } - public string DeploymentType { get { throw null; } set { } } + public string DeploymentParameterType { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.KeyVaultParameterReference Reference { get { throw null; } set { } } public System.BinaryData Value { get { throw null; } set { } } Azure.ResourceManager.Resources.Models.DeploymentParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs new file mode 100644 index 0000000000000..2dacb9d379ac6 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + /// + /// A class representing the ArmDeploymentStack data model. + /// Deployment stack object. + /// + public partial class ArmDeploymentStackData : ResourceData + { + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs index d14c4b327aec4..a55017a317fbd 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs @@ -13,13 +13,14 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ManagementGroups; namespace Azure.ResourceManager.Resources { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetArmDeploymentStacks method from an instance of . + /// Each in the collection will belong to the same instance of , or . + /// To get an instance call the GetArmDeploymentStacks method from an instance of , or . /// public partial class ArmDeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs index 39cb0a4b947eb..fd58e28c1f83d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs @@ -30,6 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteStartObject(); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -41,8 +46,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteEndObject(); } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); if (options.Format != "W") { writer.WritePropertyName("id"u8); @@ -244,8 +247,8 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { return null; } + AzureLocation? location = default; IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -274,6 +277,15 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -288,11 +300,6 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle tags = dictionary; continue; } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -529,8 +536,8 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle name, type, systemData, - tags ?? new ChangeTrackingDictionary(), location, + tags ?? new ChangeTrackingDictionary(), error, template, templateLink, @@ -596,8 +603,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } } hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs index 34349fa7e1846..62b863a54dbfa 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs @@ -17,7 +17,7 @@ namespace Azure.ResourceManager.Resources /// A class representing the ArmDeploymentStack data model. /// Deployment stack object. /// - public partial class ArmDeploymentStackData : TrackedResourceData + public partial class ArmDeploymentStackData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -52,9 +52,9 @@ public partial class ArmDeploymentStackData : TrackedResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The location. - public ArmDeploymentStackData(AzureLocation location) : base(location) + public ArmDeploymentStackData() { + Tags = new ChangeTrackingDictionary(); Parameters = new ChangeTrackingDictionary(); DetachedResources = new ChangeTrackingList(); DeletedResources = new ChangeTrackingList(); @@ -67,8 +67,8 @@ public ArmDeploymentStackData(AzureLocation location) : base(location) /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. + /// The location of the Deployment stack. It cannot be changed after creation. It must be one of the supported Azure locations. + /// Deployment stack resource tags. /// The error detail. /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. @@ -90,8 +90,10 @@ public ArmDeploymentStackData(AzureLocation location) : base(location) /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { + Location = location; + Tags = tags; Error = error; Template = template; TemplateLink = templateLink; @@ -115,11 +117,12 @@ internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ArmDeploymentStackData() - { - } - + /// The location of the Deployment stack. It cannot be changed after creation. It must be one of the supported Azure locations. + [WirePath("location")] + public AzureLocation? Location { get; set; } + /// Deployment stack resource tags. + [WirePath("tags")] + public IDictionary Tags { get; } /// The error detail. [WirePath("properties.error")] public ResponseError Error { get; set; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs index 495c5cc033762..813346ae99fe1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ManagementGroups; using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Resources @@ -20,7 +21,7 @@ namespace Azure.ResourceManager.Resources /// A Class representing an ArmDeploymentStack along with the instance operations that can be performed on it. /// If you have a you can construct an /// from an instance of using the GetArmDeploymentStackResource method. - /// Otherwise you can get one from its parent resource using the GetArmDeploymentStack method. + /// Otherwise you can get one from its parent resource , or using the GetArmDeploymentStack method. /// public partial class ArmDeploymentStackResource : ArmResource { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index 74ea72dc24f48..2f1b905a61be3 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -865,8 +865,8 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. + /// The location of the Deployment stack. It cannot be changed after creation. It must be one of the supported Azure locations. + /// Deployment stack resource tags. /// The error detail. /// The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. @@ -888,7 +888,7 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// A new instance for mocking. - public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) { tags ??= new Dictionary(); parameters ??= new Dictionary(); @@ -902,8 +902,8 @@ public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier i name, resourceType, systemData, - tags, location, + tags, error, template, templateLink, diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs index 6bb7ab5bbb7ca..7cb4018edec2c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs @@ -5,9 +5,6 @@ #nullable disable -using System; -using System.Threading; -using System.Threading.Tasks; using Azure.Core; namespace Azure.ResourceManager.Resources.Mocking @@ -37,78 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ArmDeploymentStackResources in the ArmClient. - /// The scope that the resource will apply against. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks(ResourceIdentifier scope) - { - return new ArmDeploymentStackCollection(Client, scope); - } - - /// - /// Gets a Deployment stack with a given name at specific scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} - /// - /// - /// Operation Id - /// DeploymentStacks_GetAtScope - /// - /// - /// Default Api Version - /// 2024-03-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The scope that the resource will apply against. - /// Name of the deployment stack. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) - { - return await GetArmDeploymentStacks(scope).GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a Deployment stack with a given name at specific scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} - /// - /// - /// Operation Id - /// DeploymentStacks_GetAtScope - /// - /// - /// Default Api Version - /// 2024-03-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The scope that the resource will apply against. - /// Name of the deployment stack. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) - { - return GetArmDeploymentStacks(scope).Get(deploymentStackName, cancellationToken); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs index 9484d8bd1c895..c926e0688109e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs @@ -101,5 +101,74 @@ public virtual Response GetArmDeployment(string deploymen { return GetArmDeployments().Get(deploymentName, cancellationToken); } + + /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + { + return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + { + return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + { + return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs index f196aa9a01c72..47d777db12ea9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs @@ -449,5 +449,74 @@ public virtual Response GetJitRequest(string jitRequestName, { return GetJitRequests().Get(jitRequestName, cancellationToken); } + + /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + { + return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + { + return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + { + return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs index 6e52cd36431c3..544b2a74bcd65 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs @@ -127,6 +127,75 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } + /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + { + return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + { + return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment stack. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + { + return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + } + /// /// Lists all the Template Specs within the specified subscriptions. /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index d6238becb42af..f28b410fde80e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -43,102 +43,6 @@ private static MockableResourcesTenantResource GetMockableResourcesTenantResourc return resource.GetCachedClient(client => new MockableResourcesTenantResource(client, resource.Id)); } - /// - /// Gets a collection of ArmDeploymentStackResources in the ArmClient. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ArmClient client, ResourceIdentifier scope) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableResourcesArmClient(client).GetArmDeploymentStacks(scope); - } - - /// - /// Gets a Deployment stack with a given name at specific scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} - /// - /// - /// Operation Id - /// DeploymentStacks_GetAtScope - /// - /// - /// Default Api Version - /// 2024-03-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Name of the deployment stack. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(client, nameof(client)); - - return await GetMockableResourcesArmClient(client).GetArmDeploymentStackAsync(scope, deploymentStackName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a Deployment stack with a given name at specific scope. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} - /// - /// - /// Operation Id - /// DeploymentStacks_GetAtScope - /// - /// - /// Default Api Version - /// 2024-03-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Name of the deployment stack. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this ArmClient client, ResourceIdentifier scope, string deploymentStackName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableResourcesArmClient(client).GetArmDeploymentStack(scope, deploymentStackName, cancellationToken); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -403,6 +307,99 @@ public static Response GetArmDeployment(this ManagementGr return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeployment(deploymentName, cancellationToken); } + /// + /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ManagementGroupResource managementGroupResource) + { + Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); + + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStacks(); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetArmDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); + + return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetArmDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); + + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + } + /// /// Gets a collection of TemplateSpecResources in the ResourceGroupResource. /// @@ -963,6 +960,99 @@ public static Response GetJitRequest(this ResourceGroupResou return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetJitRequest(jitRequestName, cancellationToken); } + /// + /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStacks(); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetArmDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetArmDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + } + /// /// Gets a collection of ArmDeploymentResources in the SubscriptionResource. /// @@ -1056,6 +1146,99 @@ public static Response GetArmDeployment(this Subscription return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeployment(deploymentName, cancellationToken); } + /// + /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStacks(); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetArmDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Deployment stack with a given name at specific scope. + /// + /// + /// Request Path + /// /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName} + /// + /// + /// Operation Id + /// DeploymentStacks_GetAtScope + /// + /// + /// Default Api Version + /// 2024-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the deployment stack. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetArmDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + } + /// /// Lists all the Template Specs within the specified subscriptions. /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs index c63792a67059b..2042c0e1d26c6 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.Serialization.cs @@ -39,10 +39,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } #endif } - if (Optional.IsDefined(DeploymentType)) + if (Optional.IsDefined(DeploymentParameterType)) { writer.WritePropertyName("type"u8); - writer.WriteStringValue(DeploymentType); + writer.WriteStringValue(DeploymentParameterType); } if (Optional.IsDefined(Reference)) { @@ -152,7 +152,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentType), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentParameterType), out propertyOverride); if (hasPropertyOverride) { builder.Append(" type: "); @@ -160,17 +160,17 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - if (Optional.IsDefined(DeploymentType)) + if (Optional.IsDefined(DeploymentParameterType)) { builder.Append(" type: "); - if (DeploymentType.Contains(Environment.NewLine)) + if (DeploymentParameterType.Contains(Environment.NewLine)) { builder.AppendLine("'''"); - builder.AppendLine($"{DeploymentType}'''"); + builder.AppendLine($"{DeploymentParameterType}'''"); } else { - builder.AppendLine($"'{DeploymentType}'"); + builder.AppendLine($"'{DeploymentParameterType}'"); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs index d4e5ea6a561d0..e810c066b72f0 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentParameter.cs @@ -52,13 +52,13 @@ public DeploymentParameter() /// Initializes a new instance of . /// Input value to the parameter. - /// Type of the value. + /// Type of the value. /// Azure Key Vault parameter reference. /// Keeps track of any properties unknown to the library. - internal DeploymentParameter(BinaryData value, string deploymentType, KeyVaultParameterReference reference, IDictionary serializedAdditionalRawData) + internal DeploymentParameter(BinaryData value, string deploymentParameterType, KeyVaultParameterReference reference, IDictionary serializedAdditionalRawData) { Value = value; - DeploymentType = deploymentType; + DeploymentParameterType = deploymentParameterType; Reference = reference; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,7 +97,7 @@ internal DeploymentParameter(BinaryData value, string deploymentType, KeyVaultPa public BinaryData Value { get; set; } /// Type of the value. [WirePath("type")] - public string DeploymentType { get; set; } + public string DeploymentParameterType { get; set; } /// Azure Key Vault parameter reference. [WirePath("reference")] public KeyVaultParameterReference Reference { get; set; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 7766a717b12b4..3d9484576f1ad 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -57,6 +57,10 @@ request-path-to-scope-resource-types: - subscriptions - resourceGroups - managementGroups + /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}: + - subscriptions + - resourceGroups + - managementGroups /{scope}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate: - subscriptions - resourceGroups diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 2d2ea9ff33cc5..1ca28f44f56f9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -138,8 +138,7 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate() { - var data = new ArmDeploymentStackData(AzureLocation.WestUS); - data.Location = null; + var data = new ArmDeploymentStackData(); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @@ -165,7 +164,7 @@ protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate( protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new ArmDeploymentStackData(location); + var data = new ArmDeploymentStackData(); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @@ -191,7 +190,7 @@ protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate protected static ArmDeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new ArmDeploymentStackData(location); + var data = new ArmDeploymentStackData(); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index cf5fe34c6c64d..322034bb5142a 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -76,6 +76,11 @@ public async Task ListRG() _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-List-"); + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + _ = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + + var deploymentStacks = subscription.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -126,10 +131,10 @@ public async Task GetSub() SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Get-"); - var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + var deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(subscription.Id), deploymentStackName)).Value; + var deploymentStackGet = (await subscription.GetArmDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); From 195d1616674373b9085ceab0a5749e3dea744c08 Mon Sep 17 00:00:00 2001 From: Dante Dalla Gasperina Date: Fri, 7 Jun 2024 16:40:23 -0400 Subject: [PATCH 10/19] update tests with generation changes. --- .../tests/ResourcesTestBase.cs | 7 ++- .../DeploymentStackCollectionTests.cs | 54 ++++++------------- .../DeploymentStackOperationsTests.cs | 22 +++----- 3 files changed, 30 insertions(+), 53 deletions(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 1ca28f44f56f9..8399123e859f9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -162,10 +162,11 @@ protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate( return data; } - protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) - { + protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { var data = new ArmDeploymentStackData(); + data.Location = location; + data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Scenario", @@ -192,6 +193,8 @@ protected static ArmDeploymentStackData CreateMGDeploymentStackDataWithTemplate( { var data = new ArmDeploymentStackData(); + data.Location = location; + data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Scenario", diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index 322034bb5142a..7748f521af5c3 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -29,9 +29,9 @@ public async Task CreateOrUpdateRG() ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; - string deploymentStackName = Recording.GenerateAssetName("deployStackExRG-CreateOrUpdate-"); + string deploymentStackName = Recording.GenerateAssetName("deployStackRG-CreateOrUpdate-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -51,9 +51,9 @@ public async Task GetRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Get-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(rg.Id), deploymentStackName)).Value; + var deploymentStackGet = (await rg.GetArmDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -73,14 +73,9 @@ public async Task ListRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-List-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + _ = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-List-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); - _ = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; - - var deploymentStacks = subscription.GetArmDeploymentStacks(); + var deploymentStacks = rg.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -100,24 +95,9 @@ public async Task CreateOrUpdateSub() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-CreateOrUpdate-"); - var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - - Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); - - await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); - } - - [TestCase] - [RecordedTest] - public async Task ValidateSub() - { - SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-CreateOrUpdate-"); + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-CreateOrUpdate-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -130,8 +110,8 @@ public async Task GetSub() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Get-"); - var deploymentStackData = CreateDeploymentStackDataWithTemplate(AzureLocation.WestUS); + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Get-"); + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); var deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackGet = (await subscription.GetArmDeploymentStackAsync(deploymentStackName)).Value; @@ -149,9 +129,9 @@ public async Task ListSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-List-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var stack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var stack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); + var deploymentStacks = subscription.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -174,7 +154,7 @@ public async Task CreateOrUpdateMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-CreateOrUpdate-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -189,9 +169,9 @@ public async Task GetMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Get-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await Client.GetArmDeploymentStackAsync(new ResourceIdentifier(managementGroup.Id), deploymentStackName)).Value; + var deploymentStackGet = (await managementGroup.GetArmDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -206,9 +186,9 @@ public async Task ListMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-List-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - _ = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + _ = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)); + var deploymentStacks = managementGroup.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index 719b2eed09c6f..8f916fa339a5b 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -31,7 +31,7 @@ public async Task DeleteRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Delete-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(rg.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -51,10 +51,9 @@ public async Task ExportRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Export-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); - - ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; + Assert.IsNotNull(deploymentStackTemplate); // TODO: Output is off by a little and may be how the template is being read. @@ -74,8 +73,7 @@ public async Task DeleteSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Delete-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -88,11 +86,9 @@ public async Task ExportSub() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Export-"); + string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Export-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(subscription.Id)); - - ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -112,7 +108,7 @@ public async Task DeleteMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Delete-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)).CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -127,9 +123,7 @@ public async Task ExportMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Export-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStackCollection = Client.GetArmDeploymentStacks(new ResourceIdentifier(managementGroup.Id)); - - ArmDeploymentStackResource deploymentStack = (await deploymentStackCollection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); From ec0d0b6218ff594a0e8edbb4ec97ccf5f4b76f5f Mon Sep 17 00:00:00 2001 From: Dante Dalla Gasperina Date: Thu, 13 Jun 2024 18:07:40 -0400 Subject: [PATCH 11/19] Updated tests and adjusted deployment stack class name. --- .../assets.json | 2 +- ...entStackData.cs => DeploymentStackData.cs} | 8 +- ...rmDeploymentStackResource.Serialization.cs | 26 --- .../src/Generated/ArmResourcesModelFactory.cs | 11 +- ...ection.cs => DeploymentStackCollection.cs} | 130 ++++++------ ...s => DeploymentStackData.Serialization.cs} | 38 ++-- ...entStackData.cs => DeploymentStackData.cs} | 12 +- .../DeploymentStackResource.Serialization.cs | 26 +++ ...Resource.cs => DeploymentStackResource.cs} | 186 +++++++++--------- .../Extensions/MockableResourcesArmClient.cs | 12 +- ...ockableResourcesManagementGroupResource.cs | 20 +- .../MockableResourcesResourceGroupResource.cs | 20 +- .../MockableResourcesSubscriptionResource.cs | 20 +- .../Extensions/ResourcesExtensions.cs | 90 ++++----- .../ArmDeploymentStackOperationSource.cs | 38 ---- .../DeploymentStackOperationSource.cs | 38 ++++ ...DeploymentStackListResult.Serialization.cs | 8 +- .../Models/DeploymentStackListResult.cs | 6 +- .../DeploymentStacksRestOperations.cs | 32 +-- .../src/autorest.md | 1 - .../tests/ResourcesTestBase.cs | 12 +- .../DeploymentStackCollectionTests.cs | 38 ++-- .../DeploymentStackOperationsTests.cs | 65 +++++- 23 files changed, 442 insertions(+), 397 deletions(-) rename sdk/resources/Azure.ResourceManager.Resources/src/Custom/{ArmDeploymentStackData.cs => DeploymentStackData.cs} (54%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackCollection.cs => DeploymentStackCollection.cs} (65%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackData.Serialization.cs => DeploymentStackData.Serialization.cs} (95%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackData.cs => DeploymentStackData.cs} (92%) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackResource.cs => DeploymentStackResource.cs} (73%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/assets.json b/sdk/resources/Azure.ResourceManager.Resources/assets.json index 3b0250ff92d65..a5a3e921d094b 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/assets.json +++ b/sdk/resources/Azure.ResourceManager.Resources/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/resources/Azure.ResourceManager.Resources", - "Tag": "net/resources/Azure.ResourceManager.Resources_fefa73f2c4" + "Tag": "net/resources/Azure.ResourceManager.Resources_b91d977a7f" } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs similarity index 54% rename from sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs index 2dacb9d379ac6..6a4b10a460370 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs @@ -3,19 +3,15 @@ #nullable disable -using System; -using System.Collections.Generic; -using Azure.Core; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Resources { /// - /// A class representing the ArmDeploymentStack data model. + /// A class representing the DeploymentStack data model. /// Deployment stack object. /// - public partial class ArmDeploymentStackData : ResourceData + public partial class DeploymentStackData : ResourceData { } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs deleted file mode 100644 index 2e805f382e98a..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Resources -{ - public partial class ArmDeploymentStackResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index 2f1b905a61be3..67a07cb580496 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -849,8 +849,7 @@ public static DecompiledFileDefinition DecompiledFileDefinition(string path = nu { return new DecompiledFileDefinition(path, contents, serializedAdditionalRawData: null); } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. @@ -860,7 +859,7 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -887,8 +886,8 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio /// The resourceId of the deployment resource created by the deployment stack. /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. - /// A new instance for mocking. - public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + /// A new instance for mocking. + public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) { tags ??= new Dictionary(); parameters ??= new Dictionary(); @@ -897,7 +896,7 @@ public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier i failedResources ??= new List(); resources ??= new List(); - return new ArmDeploymentStackData( + return new DeploymentStackData( id, name, resourceType, diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs similarity index 65% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs index a55017a317fbd..df33115caa974 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of , or . - /// To get an instance call the GetArmDeploymentStacks method from an instance of , or . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of , or . + /// To get a instance call the GetDeploymentStacks method from an instance of , or . /// - public partial class ArmDeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class DeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; - private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; + private readonly ClientDiagnostics _deploymentStackClientDiagnostics; + private readonly DeploymentStacksRestOperations _deploymentStackRestClient; - /// Initializes a new instance of the class for mocking. - protected ArmDeploymentStackCollection() + /// Initializes a new instance of the class for mocking. + protected DeploymentStackCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ArmDeploymentStackResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ArmDeploymentStackResource.ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); - _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); + _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", DeploymentStackResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeploymentStackResource.ResourceType, out string deploymentStackApiVersion); + _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); } /// @@ -59,7 +59,7 @@ internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : /// /// /// Resource - /// + /// /// /// /// @@ -69,17 +69,17 @@ internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -108,7 +108,7 @@ public virtual async Task> CreateOrUpda /// /// /// Resource - /// + /// /// /// /// @@ -118,17 +118,17 @@ public virtual async Task> CreateOrUpda /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -157,7 +157,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Resource - /// + /// /// /// /// @@ -165,18 +165,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -202,7 +202,7 @@ public virtual async Task> GetAsync(string /// /// /// Resource - /// + /// /// /// /// @@ -210,18 +210,18 @@ public virtual async Task> GetAsync(string /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -247,17 +247,17 @@ public virtual Response Get(string deploymentStackNa /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -277,17 +277,17 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -307,7 +307,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Resource - /// + /// /// /// /// @@ -319,11 +319,11 @@ public virtual async Task> ExistsAsync(string deploymentStackName { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -350,7 +350,7 @@ public virtual async Task> ExistsAsync(string deploymentStackName /// /// /// Resource - /// + /// /// /// /// @@ -362,11 +362,11 @@ public virtual Response Exists(string deploymentStackName, CancellationTok { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -393,7 +393,7 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// /// /// Resource - /// + /// /// /// /// @@ -401,18 +401,18 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -438,7 +438,7 @@ public virtual async Task> GetIfExi /// /// /// Resource - /// + /// /// /// /// @@ -446,18 +446,18 @@ public virtual async Task> GetIfExi /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -466,7 +466,7 @@ public virtual NullableResponse GetIfExists(string d } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -476,7 +476,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs similarity index 95% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs index fd58e28c1f83d..b87a44ec0eb74 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs @@ -17,16 +17,16 @@ namespace Azure.ResourceManager.Resources { - public partial class ArmDeploymentStackData : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStackData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -227,19 +227,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackData(document.RootElement, options); + return DeserializeDeploymentStackData(document.RootElement, options); } - internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -531,7 +531,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackData( + return new DeploymentStackData( id, name, type, @@ -1064,9 +1064,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -1075,26 +1075,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackData(document.RootElement, options); + return DeserializeDeploymentStackData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs similarity index 92% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs index 62b863a54dbfa..4078243e51012 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing the ArmDeploymentStack data model. + /// A class representing the DeploymentStack data model. /// Deployment stack object. /// - public partial class ArmDeploymentStackData : ResourceData + public partial class DeploymentStackData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,8 +51,8 @@ public partial class ArmDeploymentStackData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ArmDeploymentStackData() + /// Initializes a new instance of . + public DeploymentStackData() { Tags = new ChangeTrackingDictionary(); Parameters = new ChangeTrackingDictionary(); @@ -62,7 +62,7 @@ public ArmDeploymentStackData() Resources = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -90,7 +90,7 @@ public ArmDeploymentStackData() /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; Tags = tags; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs new file mode 100644 index 0000000000000..fcb29ed47817c --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Resources +{ + public partial class DeploymentStackResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs similarity index 73% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs index 813346ae99fe1..94f9f1e5abac1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs @@ -18,14 +18,14 @@ namespace Azure.ResourceManager.Resources { /// - /// A Class representing an ArmDeploymentStack along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetArmDeploymentStackResource method. - /// Otherwise you can get one from its parent resource , or using the GetArmDeploymentStack method. + /// A Class representing a DeploymentStack along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeploymentStackResource method. + /// Otherwise you can get one from its parent resource , or using the GetDeploymentStack method. /// - public partial class ArmDeploymentStackResource : ArmResource + public partial class DeploymentStackResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The scope. /// The deploymentStackName. public static ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) @@ -34,35 +34,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string scope, string d return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; - private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; - private readonly ArmDeploymentStackData _data; + private readonly ClientDiagnostics _deploymentStackClientDiagnostics; + private readonly DeploymentStacksRestOperations _deploymentStackRestClient; + private readonly DeploymentStackData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Resources/deploymentStacks"; - /// Initializes a new instance of the class for mocking. - protected ArmDeploymentStackResource() + /// Initializes a new instance of the class for mocking. + protected DeploymentStackResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ArmDeploymentStackResource(ArmClient client, ArmDeploymentStackData data) : this(client, data.Id) + internal DeploymentStackResource(ArmClient client, DeploymentStackData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal ArmDeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); - _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); + _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deploymentStackApiVersion); + _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal ArmDeploymentStackResource(ArmClient client, ResourceIdentifier id) : b /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ArmDeploymentStackData Data + public virtual DeploymentStackData Data { get { @@ -106,21 +106,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -146,21 +146,21 @@ public virtual async Task> GetAsync(Cancell /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -186,7 +186,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -198,12 +198,12 @@ public virtual Response Get(CancellationToken cancel /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = await _deploymentStackRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// /// /// Resource - /// + /// /// /// /// @@ -244,12 +244,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); - var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = _deploymentStackRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); + var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -278,7 +278,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// /// /// Resource - /// + /// /// /// /// @@ -286,16 +286,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -324,7 +324,7 @@ public virtual async Task> UpdateAsync( /// /// /// Resource - /// + /// /// /// /// @@ -332,16 +332,16 @@ public virtual async Task> UpdateAsync( /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -370,18 +370,18 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ExportTemplate"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -408,18 +408,18 @@ public virtual async Task> ExportTem /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. public virtual Response ExportTemplate(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ExportTemplate"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _deploymentStackRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -446,7 +446,7 @@ public virtual Response ExportTemplate(Cancel /// /// /// Resource - /// + /// /// /// /// @@ -454,16 +454,16 @@ public virtual Response ExportTemplate(Cancel /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _deploymentStackRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -492,7 +492,7 @@ public virtual async Task> ValidateS /// /// /// Resource - /// + /// /// /// /// @@ -500,16 +500,16 @@ public virtual async Task> ValidateS /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual ArmOperation ValidateStack(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateStack(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _deploymentStackRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -538,7 +538,7 @@ public virtual ArmOperation ValidateStack(WaitUnt /// /// /// Resource - /// + /// /// /// /// @@ -546,12 +546,12 @@ public virtual ArmOperation ValidateStack(WaitUnt /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); scope.Start(); try { @@ -560,8 +560,8 @@ public virtual async Task> AddTagAsync(stri var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -595,7 +595,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Resource - /// + /// /// /// /// @@ -603,12 +603,12 @@ public virtual async Task> AddTagAsync(stri /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); scope.Start(); try { @@ -617,8 +617,8 @@ public virtual Response AddTag(string key, string va var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -652,18 +652,18 @@ public virtual Response AddTag(string key, string va /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); scope.Start(); try { @@ -673,8 +673,8 @@ public virtual async Task> SetTagsAsync(IDi var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -708,18 +708,18 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); scope.Start(); try { @@ -729,8 +729,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -784,8 +784,8 @@ public virtual async Task> RemoveTagAsync(s var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -819,18 +819,18 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -839,8 +839,8 @@ public virtual Response RemoveTag(string key, Cancel var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs index 7cb4018edec2c..3e29a2690d062 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs @@ -131,15 +131,15 @@ public virtual JitRequestResource GetJitRequestResource(ResourceIdentifier id) } /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual ArmDeploymentStackResource GetArmDeploymentStackResource(ResourceIdentifier id) + /// Returns a object. + public virtual DeploymentStackResource GetDeploymentStackResource(ResourceIdentifier id) { - ArmDeploymentStackResource.ValidateResourceId(id); - return new ArmDeploymentStackResource(Client, id); + DeploymentStackResource.ValidateResourceId(id); + return new DeploymentStackResource(Client, id); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs index c926e0688109e..db346608464c2 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs @@ -102,11 +102,11 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } - /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + /// Gets a collection of DeploymentStackResources in the ManagementGroupResource. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks() { - return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + return GetCachedClient(client => new DeploymentStackCollection(client, Id)); } /// @@ -126,7 +126,7 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -135,9 +135,9 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -157,7 +157,7 @@ public virtual async Task> GetArmDeployment /// /// /// Resource - /// + /// /// /// /// @@ -166,9 +166,9 @@ public virtual async Task> GetArmDeployment /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs index 47d777db12ea9..6bdcc9a0735a1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs @@ -450,11 +450,11 @@ public virtual Response GetJitRequest(string jitRequestName, return GetJitRequests().Get(jitRequestName, cancellationToken); } - /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + /// Gets a collection of DeploymentStackResources in the ResourceGroupResource. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks() { - return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + return GetCachedClient(client => new DeploymentStackCollection(client, Id)); } /// @@ -474,7 +474,7 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -483,9 +483,9 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -505,7 +505,7 @@ public virtual async Task> GetArmDeployment /// /// /// Resource - /// + /// /// /// /// @@ -514,9 +514,9 @@ public virtual async Task> GetArmDeployment /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs index 544b2a74bcd65..ea1f959ac617d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs @@ -127,11 +127,11 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } - /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + /// Gets a collection of DeploymentStackResources in the SubscriptionResource. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks() { - return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + return GetCachedClient(client => new DeploymentStackCollection(client, Id)); } /// @@ -151,7 +151,7 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -160,9 +160,9 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -182,7 +182,7 @@ public virtual async Task> GetArmDeployment /// /// /// Resource - /// + /// /// /// /// @@ -191,9 +191,9 @@ public virtual async Task> GetArmDeployment /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index f28b410fde80e..7ab531c5154d6 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -196,22 +196,22 @@ public static JitRequestResource GetJitRequestResource(this ArmClient client, Re } /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ArmDeploymentStackResource GetArmDeploymentStackResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeploymentStackResource GetDeploymentStackResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableResourcesArmClient(client).GetArmDeploymentStackResource(id); + return GetMockableResourcesArmClient(client).GetDeploymentStackResource(id); } /// @@ -308,20 +308,20 @@ public static Response GetArmDeployment(this ManagementGr } /// - /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. + /// Gets a collection of DeploymentStackResources in the ManagementGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ManagementGroupResource managementGroupResource) + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this ManagementGroupResource managementGroupResource) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStacks(); + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStacks(); } /// @@ -341,12 +341,12 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Managemen /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -355,11 +355,11 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Managemen /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -379,12 +379,12 @@ public static async Task> GetArmDeploymentS /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -393,11 +393,11 @@ public static async Task> GetArmDeploymentS /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStack(deploymentStackName, cancellationToken); } /// @@ -961,20 +961,20 @@ public static Response GetJitRequest(this ResourceGroupResou } /// - /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. + /// Gets a collection of DeploymentStackResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStacks(); + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStacks(); } /// @@ -994,12 +994,12 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceG /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1008,11 +1008,11 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceG /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -1032,12 +1032,12 @@ public static async Task> GetArmDeploymentS /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1046,11 +1046,11 @@ public static async Task> GetArmDeploymentS /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStack(deploymentStackName, cancellationToken); } /// @@ -1147,20 +1147,20 @@ public static Response GetArmDeployment(this Subscription } /// - /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. + /// Gets a collection of DeploymentStackResources in the SubscriptionResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this SubscriptionResource subscriptionResource) + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this SubscriptionResource subscriptionResource) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStacks(); + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStacks(); } /// @@ -1180,12 +1180,12 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Subscript /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1194,11 +1194,11 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Subscript /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -1218,12 +1218,12 @@ public static async Task> GetArmDeploymentS /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1232,11 +1232,11 @@ public static async Task> GetArmDeploymentS /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStack(deploymentStackName, cancellationToken); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs deleted file mode 100644 index 470c7cbd2de4e..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.Resources -{ - internal class ArmDeploymentStackOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ArmDeploymentStackOperationSource(ArmClient client) - { - _client = client; - } - - ArmDeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); - return new ArmDeploymentStackResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); - return new ArmDeploymentStackResource(_client, data); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs new file mode 100644 index 0000000000000..24d61a2df9aa0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Resources +{ + internal class DeploymentStackOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DeploymentStackOperationSource(ArmClient client) + { + _client = client; + } + + DeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return new DeploymentStackResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return new DeploymentStackResource(_client, data); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs index 1d3084855711c..205eeb12438fe 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs @@ -81,7 +81,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,10 +93,10 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ArmDeploymentStackData.DeserializeArmDeploymentStackData(item, options)); + array.Add(DeploymentStackData.DeserializeDeploymentStackData(item, options)); } value = array; continue; @@ -112,7 +112,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs index b32693cf5cf90..8b6ba6dd33ca0 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs @@ -48,14 +48,14 @@ internal partial class DeploymentStackListResult /// Initializes a new instance of . internal DeploymentStackListResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// An array of Deployment stacks. /// The URL to use for getting the next set of results. /// Keeps track of any properties unknown to the library. - internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal DeploymentStackListResult(IReadOnlyList value, } /// An array of Deployment stacks. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The URL to use for getting the next set of results. public string NextLink { get; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs index cfb34097d3b8d..0169d77f4adea 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -122,7 +122,7 @@ public Response ExportTemplateAtScope(string } } - internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -135,7 +135,7 @@ internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, st return uri; } - internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -165,7 +165,7 @@ internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -191,7 +191,7 @@ public async Task ValidateStackAtScopeAsync(string scope, string deplo /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response ValidateStackAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public Response ValidateStackAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -286,7 +286,7 @@ public Response ListAtScope(string scope, Cancellatio } } - internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -298,7 +298,7 @@ internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, s return uri; } - internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -327,7 +327,7 @@ internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, strin /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -352,7 +352,7 @@ public async Task CreateOrUpdateAtScopeAsync(string scope, string depl /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -406,7 +406,7 @@ internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymen /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -417,13 +417,13 @@ public async Task> GetAtScopeAsync(string scope { case 200: { - ArmDeploymentStackData value = default; + DeploymentStackData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ArmDeploymentStackData)null, message.Response); + return Response.FromValue((DeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -435,7 +435,7 @@ public async Task> GetAtScopeAsync(string scope /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -446,13 +446,13 @@ public Response GetAtScope(string scope, string deployme { case 200: { - ArmDeploymentStackData value = default; + DeploymentStackData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ArmDeploymentStackData)null, message.Response); + return Response.FromValue((DeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 3d9484576f1ad..64798e0f8c691 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -28,7 +28,6 @@ enable-bicep-serialization: true rename-mapping: DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition - DeploymentStack: ArmDeploymentStack DeploymentParameter.type: DeploymentParameterType patch-initializer-customization: diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 8399123e859f9..1b5e771f9bea6 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -136,9 +136,9 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem Location = location }; - protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate() + protected static DeploymentStackData CreateRGDeploymentStackDataWithTemplate() { - var data = new ArmDeploymentStackData(); + var data = new DeploymentStackData(); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @@ -162,8 +162,8 @@ protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate( return data; } - protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new ArmDeploymentStackData(); + protected static DeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { + var data = new DeploymentStackData(); data.Location = location; @@ -189,9 +189,9 @@ protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate return data; } - protected static ArmDeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) + protected static DeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new ArmDeploymentStackData(); + var data = new DeploymentStackData(); data.Location = location; diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index 7748f521af5c3..cb6e69387afc4 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -31,7 +31,7 @@ public async Task CreateOrUpdateRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-CreateOrUpdate-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -51,9 +51,9 @@ public async Task GetRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Get-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await rg.GetArmDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await rg.GetDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -73,17 +73,17 @@ public async Task ListRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-List-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - _ = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = rg.GetArmDeploymentStacks(); + var deploymentStacks = rg.GetDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { count++; - await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } Assert.AreEqual(count, 1); + await getStack.DeleteAsync(WaitUntil.Completed); await rg.DeleteAsync(WaitUntil.Completed); } @@ -97,7 +97,7 @@ public async Task CreateOrUpdateSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-CreateOrUpdate-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -112,9 +112,9 @@ public async Task GetSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Get-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await subscription.GetArmDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await subscription.GetDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -129,16 +129,16 @@ public async Task ListSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-List-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var stack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = subscription.GetArmDeploymentStacks(); + var deploymentStacks = subscription.GetDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { count++; } - await stack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); + await getStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); // There are more stacks in the sub than just the one created for the test: Assert.GreaterOrEqual(count, 1); @@ -154,7 +154,7 @@ public async Task CreateOrUpdateMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-CreateOrUpdate-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -169,9 +169,9 @@ public async Task GetMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Get-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await managementGroup.GetArmDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await managementGroup.GetDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -186,20 +186,20 @@ public async Task ListMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-List-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - _ = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = managementGroup.GetArmDeploymentStacks(); + var deploymentStacks = managementGroup.GetDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { count++; - await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } Assert.AreEqual(count, 1); + await getStack.DeleteAsync(WaitUntil.Completed); } - private static void AssertValidDeploymentStack(ArmDeploymentStackResource model, ArmDeploymentStackResource getResult) + private static void AssertValidDeploymentStack(DeploymentStackResource model, DeploymentStackResource getResult) { Assert.AreEqual(model.Data.Name, getResult.Data.Name); Assert.AreEqual(model.Data.Id, getResult.Data.Id); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index 8f916fa339a5b..f287cb4a9df45 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -31,7 +31,7 @@ public async Task DeleteRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Delete-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -51,7 +51,7 @@ public async Task ExportRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Export-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -63,6 +63,27 @@ public async Task ExportRG() await rg.DeleteAsync(WaitUntil.Completed); } + [TestCase] + [RecordedTest] + public async Task ValidateRG() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string rgName = Recording.GenerateAssetName("testRg-1-"); + ResourceGroupData rgData = new ResourceGroupData(AzureLocation.WestUS); + ResourceGroupResource rg = (await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, rgData)).Value; + + string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Validate-"); + var deploymentStackId = new ResourceIdentifier(rg.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); + var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); + + var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); + DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + + Assert.IsNotNull(deploymentStackValidateResult); + await rg.DeleteAsync(WaitUntil.Completed); + } + /* Sub Scoped Deployment Stack Tests */ [TestCase] @@ -73,7 +94,7 @@ public async Task DeleteSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Delete-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -86,9 +107,9 @@ public async Task ExportSub() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - string deploymentStackName = Recording.GenerateAssetName("deployStackEx-Export-"); + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Export-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -98,6 +119,21 @@ public async Task ExportSub() await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } + [TestCase] + [RecordedTest] + public async Task ValidateSub() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + + string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Validate-"); + var deploymentStackId = new ResourceIdentifier(subscription.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); + var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); + + var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); + DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + Assert.NotNull(deploymentStackValidateResult); + } + /* MG Scoped Deployment Stack Tests */ [TestCase] @@ -108,7 +144,7 @@ public async Task DeleteMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Delete-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -123,7 +159,7 @@ public async Task ExportMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Export-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -132,5 +168,20 @@ public async Task ExportMG() await deploymentStack.DeleteAsync(WaitUntil.Completed, unmanageActionResources: UnmanageActionResourceMode.Delete, unmanageActionResourceGroups: UnmanageActionResourceGroupMode.Delete, unmanageActionManagementGroups: UnmanageActionManagementGroupMode.Delete); } + + [TestCase] + [RecordedTest] + public async Task ValidateMG() + { + ManagementGroupResource managementGroup = Client.GetManagementGroupResource(ManagementGroupResource.CreateResourceIdentifier("StacksSDKTest")); + + string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Validate-"); + var deploymentStackId = new ResourceIdentifier(managementGroup.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); + var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); + + var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); + DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + Assert.IsNotNull(deploymentStackValidateResult); + } } } From 97c2c4b699bf5a087a7b2ac629d580403b3d36b8 Mon Sep 17 00:00:00 2001 From: Dante DG Date: Tue, 25 Jun 2024 15:47:39 -0400 Subject: [PATCH 12/19] rebase generation --- .../src/Generated/Models/DenySettingsMode.cs | 2 +- .../src/Generated/Models/DenyStatusMode.cs | 2 +- .../src/Generated/Models/DeploymentStackProvisioningState.cs | 2 +- .../src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs | 2 +- .../src/Generated/Models/ResourceStatusMode.cs | 2 +- .../src/Generated/Models/UnmanageActionManagementGroupMode.cs | 2 +- .../src/Generated/Models/UnmanageActionResourceGroupMode.cs | 2 +- .../src/Generated/Models/UnmanageActionResourceMode.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs index 14edf50fff1ca..4ff2064c8b802 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenySettingsMode.cs @@ -47,7 +47,7 @@ public DenySettingsMode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs index b97021d5f01e7..4fdd08e77956d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DenyStatusMode.cs @@ -56,7 +56,7 @@ public DenyStatusMode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs index ebbfe6e82c390..904280f2d6e18 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackProvisioningState.cs @@ -71,7 +71,7 @@ public DeploymentStackProvisioningState(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs index ec56105c734f2..b59810cebb3b7 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs @@ -44,7 +44,7 @@ public DeploymentStacksDeleteDetachEnum(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs index 4747b2f489e4f..42fa3a9618a5c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ResourceStatusMode.cs @@ -47,7 +47,7 @@ public ResourceStatusMode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs index aedc4bc16cdd0..70208e28cf011 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionManagementGroupMode.cs @@ -44,7 +44,7 @@ public UnmanageActionManagementGroupMode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs index 15a08f95fe5b6..d23a76128b002 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceGroupMode.cs @@ -44,7 +44,7 @@ public UnmanageActionResourceGroupMode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs index e748cd8d8b0c1..5cdceac5f4b6d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/UnmanageActionResourceMode.cs @@ -44,7 +44,7 @@ public UnmanageActionResourceMode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } From ebe70b01f2247dc3697a636c085a92eef8f6aedf Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 26 Jun 2024 10:28:21 +0800 Subject: [PATCH 13/19] update --- .../Azure.ResourceManager.Resources.sln | 14 -- ...esourceManager.Resources.netstandard2.0.cs | 2 +- ...StackData.cs => ArmDeploymentStackData.cs} | 4 +- ...ion.cs => ArmDeploymentStackCollection.cs} | 130 ++++++------ ...> ArmDeploymentStackData.Serialization.cs} | 38 ++-- ...StackData.cs => ArmDeploymentStackData.cs} | 12 +- ...rmDeploymentStackResource.Serialization.cs | 26 +++ ...ource.cs => ArmDeploymentStackResource.cs} | 186 +++++++++--------- .../src/Generated/ArmResourcesModelFactory.cs | 8 +- .../DeploymentStackResource.Serialization.cs | 26 --- .../Extensions/MockableResourcesArmClient.cs | 12 +- ...ockableResourcesManagementGroupResource.cs | 20 +- .../MockableResourcesResourceGroupResource.cs | 20 +- .../MockableResourcesSubscriptionResource.cs | 20 +- .../Extensions/ResourcesExtensions.cs | 90 ++++----- .../ArmDeploymentStackOperationSource.cs | 38 ++++ .../DeploymentStackOperationSource.cs | 38 ---- ...DeploymentStackListResult.Serialization.cs | 8 +- .../Models/DeploymentStackListResult.cs | 6 +- .../DeploymentStacksRestOperations.cs | 32 +-- .../src/autorest.md | 2 +- .../tests/ResourcesTestBase.cs | 12 +- .../DeploymentStackCollectionTests.cs | 32 +-- .../DeploymentStackOperationsTests.cs | 18 +- 24 files changed, 390 insertions(+), 404 deletions(-) rename sdk/resources/Azure.ResourceManager.Resources/src/Custom/{DeploymentStackData.cs => ArmDeploymentStackData.cs} (68%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackCollection.cs => ArmDeploymentStackCollection.cs} (65%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackData.Serialization.cs => ArmDeploymentStackData.Serialization.cs} (95%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackData.cs => ArmDeploymentStackData.cs} (92%) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{DeploymentStackResource.cs => ArmDeploymentStackResource.cs} (73%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/Azure.ResourceManager.Resources.sln b/sdk/resources/Azure.ResourceManager.Resources/Azure.ResourceManager.Resources.sln index 9ac6f4b080a33..89158324f5ae9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/Azure.ResourceManager.Resources.sln +++ b/sdk/resources/Azure.ResourceManager.Resources/Azure.ResourceManager.Resources.sln @@ -2,8 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.6.33829.357 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{62AF7C88-CE3F-416E-B18E-BC6F884C89E2}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Resources", "src\Azure.ResourceManager.Resources.csproj", "{DEFF4395-FBD0-4205-95DE-7992E79015FA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Resources.Tests", "tests\Azure.ResourceManager.Resources.Tests.csproj", "{9D842058-41AB-42DD-82C8-F3DF49E25297}" @@ -20,18 +18,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Debug|x64.ActiveCfg = Debug|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Debug|x64.Build.0 = Debug|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Debug|x86.ActiveCfg = Debug|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Debug|x86.Build.0 = Debug|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Release|Any CPU.Build.0 = Release|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Release|x64.ActiveCfg = Release|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Release|x64.Build.0 = Release|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Release|x86.ActiveCfg = Release|Any CPU - {62AF7C88-CE3F-416E-B18E-BC6F884C89E2}.Release|x86.Build.0 = Release|Any CPU {DEFF4395-FBD0-4205-95DE-7992E79015FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DEFF4395-FBD0-4205-95DE-7992E79015FA}.Debug|Any CPU.Build.0 = Debug|Any CPU {DEFF4395-FBD0-4205-95DE-7992E79015FA}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index 526f010c37ffc..f1f57414c5015 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -1230,7 +1230,6 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.BasicArmDependency BasicArmDependency(string id = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompiledFileDefinition DecompiledFileDefinition(string path = null, string contents = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult DecompileOperationSuccessResult(System.Collections.Generic.IEnumerable files = null, string entryPoint = null) { throw null; } - public static Azure.ResourceManager.Resources.DeploymentStackData DeploymentStackData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult DeploymentStackValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties properties = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeploymentExtended(string provisioningState = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentType? deploymentType = default(Azure.ResourceManager.Resources.Models.ErrorDeploymentType?), string deploymentName = null) { throw null; } @@ -1343,6 +1342,7 @@ internal DecompileOperationSuccessResult() { } Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class DenySettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DenySettings(Azure.ResourceManager.Resources.Models.DenySettingsMode mode) { } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs similarity index 68% rename from sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs index 6a4b10a460370..0f04c58e9d4f0 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs @@ -8,10 +8,10 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing the DeploymentStack data model. + /// A class representing the ArmDeploymentStack data model. /// Deployment stack object. /// - public partial class DeploymentStackData : ResourceData + public partial class ArmDeploymentStackData : ResourceData { } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs similarity index 65% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs index df33115caa974..a55017a317fbd 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of , or . - /// To get a instance call the GetDeploymentStacks method from an instance of , or . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of , or . + /// To get an instance call the GetArmDeploymentStacks method from an instance of , or . /// - public partial class DeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ArmDeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _deploymentStackClientDiagnostics; - private readonly DeploymentStacksRestOperations _deploymentStackRestClient; + private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; + private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; - /// Initializes a new instance of the class for mocking. - protected DeploymentStackCollection() + /// Initializes a new instance of the class for mocking. + protected ArmDeploymentStackCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", DeploymentStackResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeploymentStackResource.ResourceType, out string deploymentStackApiVersion); - _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); + _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ArmDeploymentStackResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ArmDeploymentStackResource.ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); + _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); } /// @@ -59,7 +59,7 @@ internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : ba /// /// /// Resource - /// + /// /// /// /// @@ -69,17 +69,17 @@ internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : ba /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -108,7 +108,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Resource - /// + /// /// /// /// @@ -118,17 +118,17 @@ public virtual async Task> CreateOrUpdateA /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -157,7 +157,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Resource - /// + /// /// /// /// @@ -165,18 +165,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -202,7 +202,7 @@ public virtual async Task> GetAsync(string dep /// /// /// Resource - /// + /// /// /// /// @@ -210,18 +210,18 @@ public virtual async Task> GetAsync(string dep /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -247,17 +247,17 @@ public virtual Response Get(string deploymentStackName, /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtScopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -277,17 +277,17 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtScopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -307,7 +307,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -319,11 +319,11 @@ public virtual async Task> ExistsAsync(string deploymentStackName { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -350,7 +350,7 @@ public virtual async Task> ExistsAsync(string deploymentStackName /// /// /// Resource - /// + /// /// /// /// @@ -362,11 +362,11 @@ public virtual Response Exists(string deploymentStackName, CancellationTok { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -393,7 +393,7 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// /// /// Resource - /// + /// /// /// /// @@ -401,18 +401,18 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -438,7 +438,7 @@ public virtual async Task> GetIfExists /// /// /// Resource - /// + /// /// /// /// @@ -446,18 +446,18 @@ public virtual async Task> GetIfExists /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -466,7 +466,7 @@ public virtual NullableResponse GetIfExists(string depl } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -476,7 +476,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs similarity index 95% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs index b87a44ec0eb74..fd58e28c1f83d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs @@ -17,16 +17,16 @@ namespace Azure.ResourceManager.Resources { - public partial class DeploymentStackData : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -227,19 +227,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStackData(document.RootElement, options); + return DeserializeArmDeploymentStackData(document.RootElement, options); } - internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -531,7 +531,7 @@ internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackData( + return new ArmDeploymentStackData( id, name, type, @@ -1064,9 +1064,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -1075,26 +1075,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{options.Format}' format."); } } - DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStackData(document.RootElement, options); + return DeserializeArmDeploymentStackData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs similarity index 92% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs index 4078243e51012..62b863a54dbfa 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing the DeploymentStack data model. + /// A class representing the ArmDeploymentStack data model. /// Deployment stack object. /// - public partial class DeploymentStackData : ResourceData + public partial class ArmDeploymentStackData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,8 +51,8 @@ public partial class DeploymentStackData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeploymentStackData() + /// Initializes a new instance of . + public ArmDeploymentStackData() { Tags = new ChangeTrackingDictionary(); Parameters = new ChangeTrackingDictionary(); @@ -62,7 +62,7 @@ public DeploymentStackData() Resources = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -90,7 +90,7 @@ public DeploymentStackData() /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// Keeps track of any properties unknown to the library. - internal DeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; Tags = tags; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs new file mode 100644 index 0000000000000..2e805f382e98a --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Resources +{ + public partial class ArmDeploymentStackResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs similarity index 73% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs index 94f9f1e5abac1..813346ae99fe1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs @@ -18,14 +18,14 @@ namespace Azure.ResourceManager.Resources { /// - /// A Class representing a DeploymentStack along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeploymentStackResource method. - /// Otherwise you can get one from its parent resource , or using the GetDeploymentStack method. + /// A Class representing an ArmDeploymentStack along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetArmDeploymentStackResource method. + /// Otherwise you can get one from its parent resource , or using the GetArmDeploymentStack method. /// - public partial class DeploymentStackResource : ArmResource + public partial class ArmDeploymentStackResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The scope. /// The deploymentStackName. public static ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) @@ -34,35 +34,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string scope, string d return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deploymentStackClientDiagnostics; - private readonly DeploymentStacksRestOperations _deploymentStackRestClient; - private readonly DeploymentStackData _data; + private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; + private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; + private readonly ArmDeploymentStackData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Resources/deploymentStacks"; - /// Initializes a new instance of the class for mocking. - protected DeploymentStackResource() + /// Initializes a new instance of the class for mocking. + protected ArmDeploymentStackResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal DeploymentStackResource(ArmClient client, DeploymentStackData data) : this(client, data.Id) + internal ArmDeploymentStackResource(ArmClient client, ArmDeploymentStackData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ArmDeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deploymentStackApiVersion); - _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); + _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); + _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual DeploymentStackData Data + public virtual ArmDeploymentStackData Data { get { @@ -106,21 +106,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); scope.Start(); try { - var response = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -146,21 +146,21 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); scope.Start(); try { - var response = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -186,7 +186,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Resource - /// + /// /// /// /// @@ -198,12 +198,12 @@ public virtual Response Get(CancellationToken cancellat /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); scope.Start(); try { - var response = await _deploymentStackRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = await _armDeploymentStackDeploymentStacksRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// /// /// Resource - /// + /// /// /// /// @@ -244,12 +244,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); scope.Start(); try { - var response = _deploymentStackRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); - var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = _armDeploymentStackDeploymentStacksRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); + var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -278,7 +278,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// /// /// Resource - /// + /// /// /// /// @@ -286,16 +286,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); scope.Start(); try { - var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -324,7 +324,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Resource - /// + /// /// /// /// @@ -332,16 +332,16 @@ public virtual async Task> UpdateAsync(Wai /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); scope.Start(); try { - var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -370,18 +370,18 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ExportTemplate"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); scope.Start(); try { - var response = await _deploymentStackRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -408,18 +408,18 @@ public virtual async Task> ExportTem /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. public virtual Response ExportTemplate(CancellationToken cancellationToken = default) { - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ExportTemplate"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); scope.Start(); try { - var response = _deploymentStackRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -446,7 +446,7 @@ public virtual Response ExportTemplate(Cancel /// /// /// Resource - /// + /// /// /// /// @@ -454,16 +454,16 @@ public virtual Response ExportTemplate(Cancel /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = await _deploymentStackRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -492,7 +492,7 @@ public virtual async Task> ValidateS /// /// /// Resource - /// + /// /// /// /// @@ -500,16 +500,16 @@ public virtual async Task> ValidateS /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual ArmOperation ValidateStack(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateStack(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = _deploymentStackRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -538,7 +538,7 @@ public virtual ArmOperation ValidateStack(WaitUnt /// /// /// Resource - /// + /// /// /// /// @@ -546,12 +546,12 @@ public virtual ArmOperation ValidateStack(WaitUnt /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); scope.Start(); try { @@ -560,8 +560,8 @@ public virtual async Task> AddTagAsync(string var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -595,7 +595,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Resource - /// + /// /// /// /// @@ -603,12 +603,12 @@ public virtual async Task> AddTagAsync(string /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); scope.Start(); try { @@ -617,8 +617,8 @@ public virtual Response AddTag(string key, string value var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -652,18 +652,18 @@ public virtual Response AddTag(string key, string value /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); scope.Start(); try { @@ -673,8 +673,8 @@ public virtual async Task> SetTagsAsync(IDicti var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -708,18 +708,18 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); scope.Start(); try { @@ -729,8 +729,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -784,8 +784,8 @@ public virtual async Task> RemoveTagAsync(stri var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -819,18 +819,18 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); + using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -839,8 +839,8 @@ public virtual Response RemoveTag(string key, Cancellat var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index 67a07cb580496..be181a0fab201 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -859,7 +859,7 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -886,8 +886,8 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio /// The resourceId of the deployment resource created by the deployment stack. /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. - /// A new instance for mocking. - public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + /// A new instance for mocking. + public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) { tags ??= new Dictionary(); parameters ??= new Dictionary(); @@ -896,7 +896,7 @@ public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = nu failedResources ??= new List(); resources ??= new List(); - return new DeploymentStackData( + return new ArmDeploymentStackData( id, name, resourceType, diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs deleted file mode 100644 index fcb29ed47817c..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Resources -{ - public partial class DeploymentStackResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs index 3e29a2690d062..7cb4018edec2c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs @@ -131,15 +131,15 @@ public virtual JitRequestResource GetJitRequestResource(ResourceIdentifier id) } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual DeploymentStackResource GetDeploymentStackResource(ResourceIdentifier id) + /// Returns a object. + public virtual ArmDeploymentStackResource GetArmDeploymentStackResource(ResourceIdentifier id) { - DeploymentStackResource.ValidateResourceId(id); - return new DeploymentStackResource(Client, id); + ArmDeploymentStackResource.ValidateResourceId(id); + return new ArmDeploymentStackResource(Client, id); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs index db346608464c2..c926e0688109e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs @@ -102,11 +102,11 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } - /// Gets a collection of DeploymentStackResources in the ManagementGroupResource. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public virtual DeploymentStackCollection GetDeploymentStacks() + /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() { - return GetCachedClient(client => new DeploymentStackCollection(client, Id)); + return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); } /// @@ -126,7 +126,7 @@ public virtual DeploymentStackCollection GetDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -135,9 +135,9 @@ public virtual DeploymentStackCollection GetDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -157,7 +157,7 @@ public virtual async Task> GetDeploymentStackA /// /// /// Resource - /// + /// /// /// /// @@ -166,9 +166,9 @@ public virtual async Task> GetDeploymentStackA /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs index 6bdcc9a0735a1..47d777db12ea9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs @@ -450,11 +450,11 @@ public virtual Response GetJitRequest(string jitRequestName, return GetJitRequests().Get(jitRequestName, cancellationToken); } - /// Gets a collection of DeploymentStackResources in the ResourceGroupResource. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public virtual DeploymentStackCollection GetDeploymentStacks() + /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() { - return GetCachedClient(client => new DeploymentStackCollection(client, Id)); + return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); } /// @@ -474,7 +474,7 @@ public virtual DeploymentStackCollection GetDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -483,9 +483,9 @@ public virtual DeploymentStackCollection GetDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -505,7 +505,7 @@ public virtual async Task> GetDeploymentStackA /// /// /// Resource - /// + /// /// /// /// @@ -514,9 +514,9 @@ public virtual async Task> GetDeploymentStackA /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs index ea1f959ac617d..544b2a74bcd65 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs @@ -127,11 +127,11 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } - /// Gets a collection of DeploymentStackResources in the SubscriptionResource. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public virtual DeploymentStackCollection GetDeploymentStacks() + /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() { - return GetCachedClient(client => new DeploymentStackCollection(client, Id)); + return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); } /// @@ -151,7 +151,7 @@ public virtual DeploymentStackCollection GetDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -160,9 +160,9 @@ public virtual DeploymentStackCollection GetDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -182,7 +182,7 @@ public virtual async Task> GetDeploymentStackA /// /// /// Resource - /// + /// /// /// /// @@ -191,9 +191,9 @@ public virtual async Task> GetDeploymentStackA /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index 7ab531c5154d6..f28b410fde80e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -196,22 +196,22 @@ public static JitRequestResource GetJitRequestResource(this ArmClient client, Re } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static DeploymentStackResource GetDeploymentStackResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ArmDeploymentStackResource GetArmDeploymentStackResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableResourcesArmClient(client).GetDeploymentStackResource(id); + return GetMockableResourcesArmClient(client).GetArmDeploymentStackResource(id); } /// @@ -308,20 +308,20 @@ public static Response GetArmDeployment(this ManagementGr } /// - /// Gets a collection of DeploymentStackResources in the ManagementGroupResource. + /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public static DeploymentStackCollection GetDeploymentStacks(this ManagementGroupResource managementGroupResource) + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ManagementGroupResource managementGroupResource) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStacks(); + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStacks(); } /// @@ -341,12 +341,12 @@ public static DeploymentStackCollection GetDeploymentStacks(this ManagementGroup /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -355,11 +355,11 @@ public static DeploymentStackCollection GetDeploymentStacks(this ManagementGroup /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetArmDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -379,12 +379,12 @@ public static async Task> GetDeploymentStackAs /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -393,11 +393,11 @@ public static async Task> GetDeploymentStackAs /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetArmDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); } /// @@ -961,20 +961,20 @@ public static Response GetJitRequest(this ResourceGroupResou } /// - /// Gets a collection of DeploymentStackResources in the ResourceGroupResource. + /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public static DeploymentStackCollection GetDeploymentStacks(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStacks(); + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStacks(); } /// @@ -994,12 +994,12 @@ public static DeploymentStackCollection GetDeploymentStacks(this ResourceGroupRe /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1008,11 +1008,11 @@ public static DeploymentStackCollection GetDeploymentStacks(this ResourceGroupRe /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetArmDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -1032,12 +1032,12 @@ public static async Task> GetDeploymentStackAs /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1046,11 +1046,11 @@ public static async Task> GetDeploymentStackAs /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetArmDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); } /// @@ -1147,20 +1147,20 @@ public static Response GetArmDeployment(this Subscription } /// - /// Gets a collection of DeploymentStackResources in the SubscriptionResource. + /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. - public static DeploymentStackCollection GetDeploymentStacks(this SubscriptionResource subscriptionResource) + /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. + public static ArmDeploymentStackCollection GetArmDeploymentStacks(this SubscriptionResource subscriptionResource) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStacks(); + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStacks(); } /// @@ -1180,12 +1180,12 @@ public static DeploymentStackCollection GetDeploymentStacks(this SubscriptionRes /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1194,11 +1194,11 @@ public static DeploymentStackCollection GetDeploymentStacks(this SubscriptionRes /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetArmDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -1218,12 +1218,12 @@ public static async Task> GetDeploymentStackAs /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1232,11 +1232,11 @@ public static async Task> GetDeploymentStackAs /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetArmDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs new file mode 100644 index 0000000000000..470c7cbd2de4e --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Resources +{ + internal class ArmDeploymentStackOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ArmDeploymentStackOperationSource(ArmClient client) + { + _client = client; + } + + ArmDeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + return new ArmDeploymentStackResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + return new ArmDeploymentStackResource(_client, data); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs deleted file mode 100644 index 24d61a2df9aa0..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.Resources -{ - internal class DeploymentStackOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal DeploymentStackOperationSource(ArmClient client) - { - _client = client; - } - - DeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); - return new DeploymentStackResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); - return new DeploymentStackResource(_client, data); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs index 205eeb12438fe..1d3084855711c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs @@ -81,7 +81,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,10 +93,10 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(DeploymentStackData.DeserializeDeploymentStackData(item, options)); + array.Add(ArmDeploymentStackData.DeserializeArmDeploymentStackData(item, options)); } value = array; continue; @@ -112,7 +112,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs index 8b6ba6dd33ca0..b32693cf5cf90 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs @@ -48,14 +48,14 @@ internal partial class DeploymentStackListResult /// Initializes a new instance of . internal DeploymentStackListResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// An array of Deployment stacks. /// The URL to use for getting the next set of results. /// Keeps track of any properties unknown to the library. - internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal DeploymentStackListResult(IReadOnlyList value, str } /// An array of Deployment stacks. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The URL to use for getting the next set of results. public string NextLink { get; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs index 0169d77f4adea..cfb34097d3b8d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -122,7 +122,7 @@ public Response ExportTemplateAtScope(string } } - internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) + internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -135,7 +135,7 @@ internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, st return uri; } - internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) + internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -165,7 +165,7 @@ internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -191,7 +191,7 @@ public async Task ValidateStackAtScopeAsync(string scope, string deplo /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response ValidateStackAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public Response ValidateStackAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -286,7 +286,7 @@ public Response ListAtScope(string scope, Cancellatio } } - internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) + internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -298,7 +298,7 @@ internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, s return uri; } - internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) + internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -327,7 +327,7 @@ internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, strin /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -352,7 +352,7 @@ public async Task CreateOrUpdateAtScopeAsync(string scope, string depl /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -406,7 +406,7 @@ internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymen /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -417,13 +417,13 @@ public async Task> GetAtScopeAsync(string scope, s { case 200: { - DeploymentStackData value = default; + ArmDeploymentStackData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeploymentStackData)null, message.Response); + return Response.FromValue((ArmDeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -435,7 +435,7 @@ public async Task> GetAtScopeAsync(string scope, s /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -446,13 +446,13 @@ public Response GetAtScope(string scope, string deploymentS { case 200: { - DeploymentStackData value = default; + ArmDeploymentStackData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((DeploymentStackData)null, message.Response); + return Response.FromValue((ArmDeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index 64798e0f8c691..e497afd35481a 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -26,9 +26,9 @@ enable-bicep-serialization: true # show-serialized-names: true rename-mapping: + DeploymentStack: ArmDeploymentStack DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition - DeploymentParameter.type: DeploymentParameterType patch-initializer-customization: ArmDeploymentContent: diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 1b5e771f9bea6..8399123e859f9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -136,9 +136,9 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem Location = location }; - protected static DeploymentStackData CreateRGDeploymentStackDataWithTemplate() + protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate() { - var data = new DeploymentStackData(); + var data = new ArmDeploymentStackData(); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @@ -162,8 +162,8 @@ protected static DeploymentStackData CreateRGDeploymentStackDataWithTemplate() return data; } - protected static DeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new DeploymentStackData(); + protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { + var data = new ArmDeploymentStackData(); data.Location = location; @@ -189,9 +189,9 @@ protected static DeploymentStackData CreateSubDeploymentStackDataWithTemplate(Az return data; } - protected static DeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) + protected static ArmDeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new DeploymentStackData(); + var data = new ArmDeploymentStackData(); data.Location = location; diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index cb6e69387afc4..59304a906ec50 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -31,7 +31,7 @@ public async Task CreateOrUpdateRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-CreateOrUpdate-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -51,9 +51,9 @@ public async Task GetRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Get-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await rg.GetDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await rg.GetArmDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -73,9 +73,9 @@ public async Task ListRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-List-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var getStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = rg.GetDeploymentStacks(); + var deploymentStacks = rg.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -97,7 +97,7 @@ public async Task CreateOrUpdateSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-CreateOrUpdate-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -112,9 +112,9 @@ public async Task GetSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Get-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await subscription.GetDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await subscription.GetArmDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -129,9 +129,9 @@ public async Task ListSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-List-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var getStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = subscription.GetDeploymentStacks(); + var deploymentStacks = subscription.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -154,7 +154,7 @@ public async Task CreateOrUpdateMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-CreateOrUpdate-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -169,9 +169,9 @@ public async Task GetMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Get-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await managementGroup.GetDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await managementGroup.GetArmDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -186,9 +186,9 @@ public async Task ListMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-List-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var getStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = managementGroup.GetDeploymentStacks(); + var deploymentStacks = managementGroup.GetArmDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -199,7 +199,7 @@ public async Task ListMG() await getStack.DeleteAsync(WaitUntil.Completed); } - private static void AssertValidDeploymentStack(DeploymentStackResource model, DeploymentStackResource getResult) + private static void AssertValidDeploymentStack(ArmDeploymentStackResource model, ArmDeploymentStackResource getResult) { Assert.AreEqual(model.Data.Name, getResult.Data.Name); Assert.AreEqual(model.Data.Id, getResult.Data.Id); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index f287cb4a9df45..72b033fef1112 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -31,7 +31,7 @@ public async Task DeleteRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Delete-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - DeploymentStackResource deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -51,7 +51,7 @@ public async Task ExportRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Export-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - DeploymentStackResource deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -75,7 +75,7 @@ public async Task ValidateRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Validate-"); var deploymentStackId = new ResourceIdentifier(rg.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); - var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); + var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; @@ -94,7 +94,7 @@ public async Task DeleteSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Delete-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -109,7 +109,7 @@ public async Task ExportSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Export-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -127,7 +127,7 @@ public async Task ValidateSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Validate-"); var deploymentStackId = new ResourceIdentifier(subscription.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); - var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); + var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; @@ -144,7 +144,7 @@ public async Task DeleteMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Delete-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -159,7 +159,7 @@ public async Task ExportMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Export-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -177,7 +177,7 @@ public async Task ValidateMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Validate-"); var deploymentStackId = new ResourceIdentifier(managementGroup.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); - var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); + var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; From f28e2ed0f08376542a5caaf61213ff7a1f41e385 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Wed, 26 Jun 2024 10:36:27 +0800 Subject: [PATCH 14/19] update --- .../Azure.ResourceManager.Resources/CHANGELOG.md | 12 ++++-------- .../src/Azure.ResourceManager.Resources.csproj | 2 +- .../Azure.ResourceManager.Resources/src/autorest.md | 12 ++++++------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md index 34bdde9a80702..d8e028c6a315c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md +++ b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.8.0-beta.1 (Unreleased) +## 1.8.0 (2024-06-26) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added `ArmDeploymentStack` support. ## 1.7.3 (2024-05-07) @@ -20,13 +16,13 @@ ### Features Added -- Add `ArmOperation.Rehydrate` and `ArmOperation.Rehydrate` static methods to rehydrate a long-running operation. +- Added `ArmOperation.Rehydrate` and `ArmOperation.Rehydrate` static methods to rehydrate a long-running operation. ## 1.7.1 (2024-03-23) ### Features Added -- Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. +- Enabled the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. - Added experimental Bicep serialization. ## 1.7.0 (2023-11-16) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Azure.ResourceManager.Resources.csproj b/sdk/resources/Azure.ResourceManager.Resources/src/Azure.ResourceManager.Resources.csproj index 8820e5463fc9b..b69250ae1cbf5 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Azure.ResourceManager.Resources.csproj +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Azure.ResourceManager.Resources.csproj @@ -1,6 +1,6 @@ - 1.8.0-beta.1 + 1.8.0 1.7.3 Azure.ResourceManager.Resources diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index e497afd35481a..d641cd0210f2f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -671,11 +671,11 @@ These settings apply only when `--tag=package-resources-2022-04` is specified on ```yaml $(tag) == 'package-resources-2022-04' input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/templateSpecs.json - - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/deploymentScripts.json - - https://github.com/Azure/azure-rest-api-specs/blob/1d994b314d45e33c6d63a9f7b729db8346b8ea0f/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/resources.json - - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Solutions/stable/2019-07-01/managedapplications.json - - https://github.com/Azure/azure-rest-api-specs/blob/6acab48bdaef738f88de60abc41826e9914ad8ad/specification/resources/resource-manager/Microsoft.Resources/stable/2023-11-01/bicepClient.json# - - https://github.com/Azure/azure-rest-api-specs/blob/1d994b314d45e33c6d63a9f7b729db8346b8ea0f/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/deploymentStacks.json + - https://github.com/Azure/azure-rest-api-specs/blob/a220053360f9700f81abcdb6142769c85c3bcb27/specification/resources/resource-manager/Microsoft.Resources/stable/2021-05-01/templateSpecs.json + - https://github.com/Azure/azure-rest-api-specs/blob/a220053360f9700f81abcdb6142769c85c3bcb27/specification/resources/resource-manager/Microsoft.Resources/stable/2020-10-01/deploymentScripts.json + - https://github.com/Azure/azure-rest-api-specs/blob/a220053360f9700f81abcdb6142769c85c3bcb27/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/resources.json + - https://github.com/Azure/azure-rest-api-specs/blob/a220053360f9700f81abcdb6142769c85c3bcb27/specification/resources/resource-manager/Microsoft.Solutions/stable/2019-07-01/managedapplications.json + - https://github.com/Azure/azure-rest-api-specs/blob/a220053360f9700f81abcdb6142769c85c3bcb27/specification/resources/resource-manager/Microsoft.Resources/stable/2023-11-01/bicepClient.json# + - https://github.com/Azure/azure-rest-api-specs/blob/a220053360f9700f81abcdb6142769c85c3bcb27/specification/resources/resource-manager/Microsoft.Resources/stable/2024-03-01/deploymentStacks.json ``` From 384e52458411e009780f85ed1deb25d39daeb4ed Mon Sep 17 00:00:00 2001 From: Dante DG Date: Wed, 26 Jun 2024 11:33:43 -0400 Subject: [PATCH 15/19] rename classes --- .../ArmDeploymentStackData.Serialization.cs | 12 ++--- .../src/Generated/ArmDeploymentStackData.cs | 10 ++-- .../Generated/ArmDeploymentStackResource.cs | 12 ++--- .../src/Generated/ArmResourcesModelFactory.cs | 20 ++++---- ...ymentStackValidateResultOperationSource.cs | 30 +++++++++++ ...ymentStackValidateResultOperationSource.cs | 30 ----------- .../Models/ActionOnUnmanage.Serialization.cs | 12 ++--- .../src/Generated/Models/ActionOnUnmanage.cs | 10 ++-- ...loymentStackDebugSetting.Serialization.cs} | 38 +++++++------- ...g.cs => ArmDeploymentStackDebugSetting.cs} | 10 ++-- .../ArmDeploymentStackDeleteDetachEnum.cs | 51 +++++++++++++++++++ ...eploymentStackListResult.Serialization.cs} | 38 +++++++------- ...ult.cs => ArmDeploymentStackListResult.cs} | 10 ++-- ...ymentStackParametersLink.Serialization.cs} | 38 +++++++------- ...cs => ArmDeploymentStackParametersLink.cs} | 14 ++--- ...tStackTemplateDefinition.Serialization.cs} | 42 +++++++-------- ...> ArmDeploymentStackTemplateDefinition.cs} | 12 ++--- ...loymentStackTemplateLink.Serialization.cs} | 38 +++++++------- ...k.cs => ArmDeploymentStackTemplateLink.cs} | 10 ++-- ...tStackValidateProperties.Serialization.cs} | 42 +++++++-------- ...> ArmDeploymentStackValidateProperties.cs} | 12 ++--- ...ymentStackValidateResult.Serialization.cs} | 42 +++++++-------- ...cs => ArmDeploymentStackValidateResult.cs} | 12 ++--- .../DeploymentStacksDeleteDetachEnum.cs | 51 ------------------- .../DeploymentStacksRestOperations.cs | 36 ++++++------- .../src/autorest.md | 11 ++++ .../DeploymentStackOperationsTests.cs | 6 +-- 27 files changed, 330 insertions(+), 319 deletions(-) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStacksDebugSetting.Serialization.cs => ArmDeploymentStackDebugSetting.Serialization.cs} (69%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStacksDebugSetting.cs => ArmDeploymentStackDebugSetting.cs} (87%) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackListResult.Serialization.cs => ArmDeploymentStackListResult.Serialization.cs} (75%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackListResult.cs => ArmDeploymentStackListResult.cs} (83%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStacksParametersLink.Serialization.cs => ArmDeploymentStackParametersLink.Serialization.cs} (72%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStacksParametersLink.cs => ArmDeploymentStackParametersLink.cs} (80%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackTemplateDefinition.Serialization.cs => ArmDeploymentStackTemplateDefinition.Serialization.cs} (70%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackTemplateDefinition.cs => ArmDeploymentStackTemplateDefinition.cs} (87%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStacksTemplateLink.Serialization.cs => ArmDeploymentStackTemplateLink.Serialization.cs} (82%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStacksTemplateLink.cs => ArmDeploymentStackTemplateLink.cs} (88%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackValidateProperties.Serialization.cs => ArmDeploymentStackValidateProperties.Serialization.cs} (86%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackValidateProperties.cs => ArmDeploymentStackValidateProperties.cs} (85%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackValidateResult.Serialization.cs => ArmDeploymentStackValidateResult.Serialization.cs} (80%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{DeploymentStackValidateResult.cs => ArmDeploymentStackValidateResult.cs} (78%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs index fd58e28c1f83d..0b2d2f720cff6 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs @@ -255,11 +255,11 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle SystemData systemData = default; ResponseError error = default; BinaryData template = default; - DeploymentStacksTemplateLink templateLink = default; + ArmDeploymentStackTemplateLink templateLink = default; IDictionary parameters = default; - DeploymentStacksParametersLink parametersLink = default; + ArmDeploymentStackParametersLink parametersLink = default; ActionOnUnmanage actionOnUnmanage = default; - DeploymentStacksDebugSetting debugSetting = default; + ArmDeploymentStackDebugSetting debugSetting = default; bool? bypassStackOutOfSyncError = default; string deploymentScope = default; string description = default; @@ -357,7 +357,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { continue; } - templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property0.Value, options); + templateLink = ArmDeploymentStackTemplateLink.DeserializeArmDeploymentStackTemplateLink(property0.Value, options); continue; } if (property0.NameEquals("parameters"u8)) @@ -380,7 +380,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { continue; } - parametersLink = DeploymentStacksParametersLink.DeserializeDeploymentStacksParametersLink(property0.Value, options); + parametersLink = ArmDeploymentStackParametersLink.DeserializeArmDeploymentStackParametersLink(property0.Value, options); continue; } if (property0.NameEquals("actionOnUnmanage"u8)) @@ -398,7 +398,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { continue; } - debugSetting = DeploymentStacksDebugSetting.DeserializeDeploymentStacksDebugSetting(property0.Value, options); + debugSetting = ArmDeploymentStackDebugSetting.DeserializeArmDeploymentStackDebugSetting(property0.Value, options); continue; } if (property0.NameEquals("bypassStackOutOfSyncError"u8)) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs index 62b863a54dbfa..cfa01e0b530bd 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs @@ -90,7 +90,7 @@ public ArmDeploymentStackData() /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, ArmDeploymentStackTemplateLink templateLink, IDictionary parameters, ArmDeploymentStackParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, ArmDeploymentStackDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; Tags = tags; @@ -160,18 +160,18 @@ internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType public BinaryData Template { get; set; } /// The URI of the template. Use either the templateLink property or the template property, but not both. [WirePath("properties.templateLink")] - public DeploymentStacksTemplateLink TemplateLink { get; set; } + public ArmDeploymentStackTemplateLink TemplateLink { get; set; } /// Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. [WirePath("properties.parameters")] public IDictionary Parameters { get; } /// The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. [WirePath("properties.parametersLink")] - public DeploymentStacksParametersLink ParametersLink { get; set; } + public ArmDeploymentStackParametersLink ParametersLink { get; set; } /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. [WirePath("properties.actionOnUnmanage")] public ActionOnUnmanage ActionOnUnmanage { get; set; } /// The debug setting of the deployment. - internal DeploymentStacksDebugSetting DebugSetting { get; set; } + internal ArmDeploymentStackDebugSetting DebugSetting { get; set; } /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. [WirePath("properties.debugSetting.detailLevel")] public string DebugSettingDetailLevel @@ -180,7 +180,7 @@ public string DebugSettingDetailLevel set { if (DebugSetting is null) - DebugSetting = new DeploymentStacksDebugSetting(); + DebugSetting = new ArmDeploymentStackDebugSetting(); DebugSetting.DetailLevel = value; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs index 813346ae99fe1..e5774b039704c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs @@ -375,7 +375,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// The cancellation token to use. - public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) + public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) { using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); scope.Start(); @@ -413,7 +413,7 @@ public virtual async Task> ExportTem /// /// /// The cancellation token to use. - public virtual Response ExportTemplate(CancellationToken cancellationToken = default) + public virtual Response ExportTemplate(CancellationToken cancellationToken = default) { using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); scope.Start(); @@ -454,7 +454,7 @@ public virtual Response ExportTemplate(Cancel /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -463,7 +463,7 @@ public virtual async Task> ValidateS try { var response = await _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new ResourcesArmOperation(new ArmDeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -500,7 +500,7 @@ public virtual async Task> ValidateS /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual ArmOperation ValidateStack(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateStack(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -509,7 +509,7 @@ public virtual ArmOperation ValidateStack(WaitUnt try { var response = _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var operation = new ResourcesArmOperation(new ArmDeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index be181a0fab201..8645b2dd2c9ab 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -850,13 +850,13 @@ public static DecompiledFileDefinition DecompiledFileDefinition(string path = nu return new DecompiledFileDefinition(path, contents, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. - /// A new instance for mocking. - public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(BinaryData template = null, DeploymentStacksTemplateLink templateLink = null) + /// A new instance for mocking. + public static ArmDeploymentStackTemplateDefinition ArmDeploymentStackTemplateDefinition(BinaryData template = null, ArmDeploymentStackTemplateLink templateLink = null) { - return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); + return new ArmDeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -887,7 +887,7 @@ public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinitio /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// A new instance for mocking. - public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, ArmDeploymentStackTemplateLink templateLink = null, IDictionary parameters = null, ArmDeploymentStackParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) { tags ??= new Dictionary(); parameters ??= new Dictionary(); @@ -909,7 +909,7 @@ public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier i parameters, parametersLink, actionOnUnmanage, - debugSettingDetailLevel != null ? new DeploymentStacksDebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, + debugSettingDetailLevel != null ? new ArmDeploymentStackDebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, bypassStackOutOfSyncError, deploymentScope, description, @@ -953,17 +953,17 @@ public static ManagedResourceReference ManagedResourceReference(string id = null return new ManagedResourceReference(id, serializedAdditionalRawData: null, status, denyStatus); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The validation result details. /// The error detail. - /// A new instance for mocking. - public static DeploymentStackValidateResult DeploymentStackValidateResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeploymentStackValidateProperties properties = null, ResponseError error = null) + /// A new instance for mocking. + public static ArmDeploymentStackValidateResult ArmDeploymentStackValidateResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ArmDeploymentStackValidateProperties properties = null, ResponseError error = null) { - return new DeploymentStackValidateResult( + return new ArmDeploymentStackValidateResult( id, name, resourceType, diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs new file mode 100644 index 0000000000000..3bca451dfb406 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + internal class ArmDeploymentStackValidateResultOperationSource : IOperationSource + { + ArmDeploymentStackValidateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return ArmDeploymentStackValidateResult.DeserializeArmDeploymentStackValidateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return ArmDeploymentStackValidateResult.DeserializeArmDeploymentStackValidateResult(document.RootElement); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs deleted file mode 100644 index fbbceab1542f4..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.Resources -{ - internal class DeploymentStackValidateResultOperationSource : IOperationSource - { - DeploymentStackValidateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return DeploymentStackValidateResult.DeserializeDeploymentStackValidateResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return DeploymentStackValidateResult.DeserializeDeploymentStackValidateResult(document.RootElement); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs index fd97fd37c2ff5..79f631f68ac4e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs @@ -77,16 +77,16 @@ internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element { return null; } - DeploymentStacksDeleteDetachEnum resources = default; - DeploymentStacksDeleteDetachEnum? resourceGroups = default; - DeploymentStacksDeleteDetachEnum? managementGroups = default; + ArmDeploymentStackDeleteDetachEnum resources = default; + ArmDeploymentStackDeleteDetachEnum? resourceGroups = default; + ArmDeploymentStackDeleteDetachEnum? managementGroups = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resources"u8)) { - resources = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); + resources = new ArmDeploymentStackDeleteDetachEnum(property.Value.GetString()); continue; } if (property.NameEquals("resourceGroups"u8)) @@ -95,7 +95,7 @@ internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element { continue; } - resourceGroups = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); + resourceGroups = new ArmDeploymentStackDeleteDetachEnum(property.Value.GetString()); continue; } if (property.NameEquals("managementGroups"u8)) @@ -104,7 +104,7 @@ internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element { continue; } - managementGroups = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); + managementGroups = new ArmDeploymentStackDeleteDetachEnum(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs index e5bfff9878bd2..d36f413bd9949 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs @@ -47,7 +47,7 @@ public partial class ActionOnUnmanage /// Initializes a new instance of . /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. - public ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources) + public ActionOnUnmanage(ArmDeploymentStackDeleteDetachEnum resources) { Resources = resources; } @@ -57,7 +57,7 @@ public ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources) /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. /// Keeps track of any properties unknown to the library. - internal ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources, DeploymentStacksDeleteDetachEnum? resourceGroups, DeploymentStacksDeleteDetachEnum? managementGroups, IDictionary serializedAdditionalRawData) + internal ActionOnUnmanage(ArmDeploymentStackDeleteDetachEnum resources, ArmDeploymentStackDeleteDetachEnum? resourceGroups, ArmDeploymentStackDeleteDetachEnum? managementGroups, IDictionary serializedAdditionalRawData) { Resources = resources; ResourceGroups = resourceGroups; @@ -72,12 +72,12 @@ internal ActionOnUnmanage() /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. [WirePath("resources")] - public DeploymentStacksDeleteDetachEnum Resources { get; set; } + public ArmDeploymentStackDeleteDetachEnum Resources { get; set; } /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. [WirePath("resourceGroups")] - public DeploymentStacksDeleteDetachEnum? ResourceGroups { get; set; } + public ArmDeploymentStackDeleteDetachEnum? ResourceGroups { get; set; } /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. [WirePath("managementGroups")] - public DeploymentStacksDeleteDetachEnum? ManagementGroups { get; set; } + public ArmDeploymentStackDeleteDetachEnum? ManagementGroups { get; set; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.Serialization.cs similarity index 69% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.Serialization.cs index a2c8a225d0952..244f809f5d800 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - internal partial class DeploymentStacksDebugSetting : IUtf8JsonSerializable, IJsonModel + internal partial class ArmDeploymentStackDebugSetting : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -50,19 +50,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - DeploymentStacksDebugSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackDebugSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStacksDebugSetting(document.RootElement, options); + return DeserializeArmDeploymentStackDebugSetting(document.RootElement, options); } - internal static DeploymentStacksDebugSetting DeserializeDeploymentStacksDebugSetting(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackDebugSetting DeserializeArmDeploymentStackDebugSetting(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,7 +86,7 @@ internal static DeploymentStacksDebugSetting DeserializeDeploymentStacksDebugSet } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStacksDebugSetting(detailLevel, serializedAdditionalRawData); + return new ArmDeploymentStackDebugSetting(detailLevel, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -127,9 +127,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -138,26 +138,26 @@ BinaryData IPersistableModel.Write(ModelReaderWrit case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support writing '{options.Format}' format."); } } - DeploymentStacksDebugSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackDebugSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStacksDebugSetting(document.RootElement, options); + return DeserializeArmDeploymentStackDebugSetting(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.cs similarity index 87% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.cs index b1c41ea88b884..66ff2ee8b5887 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// The debug setting. - internal partial class DeploymentStacksDebugSetting + internal partial class ArmDeploymentStackDebugSetting { /// /// Keeps track of any properties unknown to the library. @@ -45,15 +45,15 @@ internal partial class DeploymentStacksDebugSetting /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeploymentStacksDebugSetting() + /// Initializes a new instance of . + public ArmDeploymentStackDebugSetting() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. /// Keeps track of any properties unknown to the library. - internal DeploymentStacksDebugSetting(string detailLevel, IDictionary serializedAdditionalRawData) + internal ArmDeploymentStackDebugSetting(string detailLevel, IDictionary serializedAdditionalRawData) { DetailLevel = detailLevel; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs new file mode 100644 index 0000000000000..e20bacab0e96b --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + public readonly partial struct ArmDeploymentStackDeleteDetachEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ArmDeploymentStackDeleteDetachEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "delete"; + private const string DetachValue = "detach"; + + /// delete. + public static ArmDeploymentStackDeleteDetachEnum Delete { get; } = new ArmDeploymentStackDeleteDetachEnum(DeleteValue); + /// detach. + public static ArmDeploymentStackDeleteDetachEnum Detach { get; } = new ArmDeploymentStackDeleteDetachEnum(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(ArmDeploymentStackDeleteDetachEnum left, ArmDeploymentStackDeleteDetachEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ArmDeploymentStackDeleteDetachEnum left, ArmDeploymentStackDeleteDetachEnum right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ArmDeploymentStackDeleteDetachEnum(string value) => new ArmDeploymentStackDeleteDetachEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ArmDeploymentStackDeleteDetachEnum other && Equals(other); + /// + public bool Equals(ArmDeploymentStackDeleteDetachEnum other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.Serialization.cs similarity index 75% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.Serialization.cs index 1d3084855711c..8e85240412d9a 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.Resources.Models { - internal partial class DeploymentStackListResult : IUtf8JsonSerializable, IJsonModel + internal partial class ArmDeploymentStackListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -61,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } - DeploymentStackListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStackListResult(document.RootElement, options); + return DeserializeArmDeploymentStackListResult(document.RootElement, options); } - internal static DeploymentStackListResult DeserializeDeploymentStackListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackListResult DeserializeArmDeploymentStackListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -112,7 +112,7 @@ internal static DeploymentStackListResult DeserializeDeploymentStackListResult(J } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ArmDeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -176,9 +176,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -187,26 +187,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support writing '{options.Format}' format."); } } - DeploymentStackListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStackListResult(document.RootElement, options); + return DeserializeArmDeploymentStackListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.cs similarity index 83% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.cs index b32693cf5cf90..70c98f3dbfc20 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// List of Deployment stacks. - internal partial class DeploymentStackListResult + internal partial class ArmDeploymentStackListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ internal partial class DeploymentStackListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal DeploymentStackListResult() + /// Initializes a new instance of . + internal ArmDeploymentStackListResult() { Value = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// An array of Deployment stacks. /// The URL to use for getting the next set of results. /// Keeps track of any properties unknown to the library. - internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ArmDeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.Serialization.cs similarity index 72% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.Serialization.cs index 2f4566cc45368..5c6cf6f1e9cd7 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class DeploymentStacksParametersLink : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackParametersLink : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -52,19 +52,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - DeploymentStacksParametersLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackParametersLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStacksParametersLink(document.RootElement, options); + return DeserializeArmDeploymentStackParametersLink(document.RootElement, options); } - internal static DeploymentStacksParametersLink DeserializeDeploymentStacksParametersLink(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackParametersLink DeserializeArmDeploymentStackParametersLink(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -94,7 +94,7 @@ internal static DeploymentStacksParametersLink DeserializeDeploymentStacksParame } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStacksParametersLink(uri, contentVersion, serializedAdditionalRawData); + return new ArmDeploymentStackParametersLink(uri, contentVersion, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -150,9 +150,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -161,26 +161,26 @@ BinaryData IPersistableModel.Write(ModelReaderWr case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support writing '{options.Format}' format."); } } - DeploymentStacksParametersLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackParametersLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStacksParametersLink(document.RootElement, options); + return DeserializeArmDeploymentStackParametersLink(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.cs similarity index 80% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.cs index 72e7f5a22a7fa..f50264d6ea96c 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// Entity representing the reference to the deployment parameters. - public partial class DeploymentStacksParametersLink + public partial class ArmDeploymentStackParametersLink { /// /// Keeps track of any properties unknown to the library. @@ -45,29 +45,29 @@ public partial class DeploymentStacksParametersLink /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The URI of the parameters file. /// is null. - public DeploymentStacksParametersLink(Uri uri) + public ArmDeploymentStackParametersLink(Uri uri) { Argument.AssertNotNull(uri, nameof(uri)); Uri = uri; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The URI of the parameters file. /// If included, must match the ContentVersion in the template. /// Keeps track of any properties unknown to the library. - internal DeploymentStacksParametersLink(Uri uri, string contentVersion, IDictionary serializedAdditionalRawData) + internal ArmDeploymentStackParametersLink(Uri uri, string contentVersion, IDictionary serializedAdditionalRawData) { Uri = uri; ContentVersion = contentVersion; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal DeploymentStacksParametersLink() + /// Initializes a new instance of for deserialization. + internal ArmDeploymentStackParametersLink() { } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.Serialization.cs similarity index 70% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.Serialization.cs index 86e22ee4f18ac..17b096465819e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class DeploymentStackTemplateDefinition : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackTemplateDefinition : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -62,19 +62,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - DeploymentStackTemplateDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackTemplateDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStackTemplateDefinition(document.RootElement, options); + return DeserializeArmDeploymentStackTemplateDefinition(document.RootElement, options); } - internal static DeploymentStackTemplateDefinition DeserializeDeploymentStackTemplateDefinition(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackTemplateDefinition DeserializeArmDeploymentStackTemplateDefinition(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +83,7 @@ internal static DeploymentStackTemplateDefinition DeserializeDeploymentStackTemp return null; } BinaryData template = default; - DeploymentStacksTemplateLink templateLink = default; + ArmDeploymentStackTemplateLink templateLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,7 +103,7 @@ internal static DeploymentStackTemplateDefinition DeserializeDeploymentStackTemp { continue; } - templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property.Value, options); + templateLink = ArmDeploymentStackTemplateLink.DeserializeArmDeploymentStackTemplateLink(property.Value, options); continue; } if (options.Format != "W") @@ -112,7 +112,7 @@ internal static DeploymentStackTemplateDefinition DeserializeDeploymentStackTemp } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData); + return new ArmDeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -160,9 +160,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -171,26 +171,26 @@ BinaryData IPersistableModel.Write(ModelReade case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support writing '{options.Format}' format."); } } - DeploymentStackTemplateDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackTemplateDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStackTemplateDefinition(document.RootElement, options); + return DeserializeArmDeploymentStackTemplateDefinition(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.cs similarity index 87% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.cs index df86a78d43da0..c4fd09a86305a 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// Export Template specific properties of the Deployment stack. - public partial class DeploymentStackTemplateDefinition + public partial class ArmDeploymentStackTemplateDefinition { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class DeploymentStackTemplateDefinition /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal DeploymentStackTemplateDefinition() + /// Initializes a new instance of . + internal ArmDeploymentStackTemplateDefinition() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. /// Keeps track of any properties unknown to the library. - internal DeploymentStackTemplateDefinition(BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary serializedAdditionalRawData) + internal ArmDeploymentStackTemplateDefinition(BinaryData template, ArmDeploymentStackTemplateLink templateLink, IDictionary serializedAdditionalRawData) { Template = template; TemplateLink = templateLink; @@ -95,6 +95,6 @@ internal DeploymentStackTemplateDefinition(BinaryData template, DeploymentStacks public BinaryData Template { get; } /// The URI of the template. Use either the templateLink property or the template property, but not both. [WirePath("templateLink")] - public DeploymentStacksTemplateLink TemplateLink { get; } + public ArmDeploymentStackTemplateLink TemplateLink { get; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.Serialization.cs similarity index 82% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.Serialization.cs index dc4c06562d8df..52240130d4122 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class DeploymentStacksTemplateLink : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackTemplateLink : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -70,19 +70,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - DeploymentStacksTemplateLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackTemplateLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStacksTemplateLink(document.RootElement, options); + return DeserializeArmDeploymentStackTemplateLink(document.RootElement, options); } - internal static DeploymentStacksTemplateLink DeserializeDeploymentStacksTemplateLink(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackTemplateLink DeserializeArmDeploymentStackTemplateLink(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -134,7 +134,7 @@ internal static DeploymentStacksTemplateLink DeserializeDeploymentStacksTemplate } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStacksTemplateLink( + return new ArmDeploymentStackTemplateLink( uri, id, relativePath, @@ -265,9 +265,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -276,26 +276,26 @@ BinaryData IPersistableModel.Write(ModelReaderWrit case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support writing '{options.Format}' format."); } } - DeploymentStacksTemplateLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackTemplateLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStacksTemplateLink(document.RootElement, options); + return DeserializeArmDeploymentStackTemplateLink(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.cs similarity index 88% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.cs index 6da14d9e0ac6d..071a62eb1a465 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// Entity representing the reference to the template. - public partial class DeploymentStacksTemplateLink + public partial class ArmDeploymentStackTemplateLink { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class DeploymentStacksTemplateLink /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeploymentStacksTemplateLink() + /// Initializes a new instance of . + public ArmDeploymentStackTemplateLink() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The URI of the template to deploy. Use either the uri or id property, but not both. /// The resourceId of a Template Spec. Use either the id or uri property, but not both. /// The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs. /// The query string (for example, a SAS token) to be used with the templateLink URI. /// If included, must match the ContentVersion in the template. /// Keeps track of any properties unknown to the library. - internal DeploymentStacksTemplateLink(Uri uri, string id, string relativePath, string queryString, string contentVersion, IDictionary serializedAdditionalRawData) + internal ArmDeploymentStackTemplateLink(Uri uri, string id, string relativePath, string queryString, string contentVersion, IDictionary serializedAdditionalRawData) { Uri = uri; Id = id; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.Serialization.cs similarity index 86% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.Serialization.cs index 42cf2b4ee0638..888c8a8254afd 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class DeploymentStackValidateProperties : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackValidateProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -97,19 +97,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } - DeploymentStackValidateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackValidateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStackValidateProperties(document.RootElement, options); + return DeserializeArmDeploymentStackValidateProperties(document.RootElement, options); } - internal static DeploymentStackValidateProperties DeserializeDeploymentStackValidateProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackValidateProperties DeserializeArmDeploymentStackValidateProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -123,7 +123,7 @@ internal static DeploymentStackValidateProperties DeserializeDeploymentStackVali string deploymentScope = default; string description = default; IDictionary parameters = default; - DeploymentStacksTemplateLink templateLink = default; + ArmDeploymentStackTemplateLink templateLink = default; IList validatedResources = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -182,7 +182,7 @@ internal static DeploymentStackValidateProperties DeserializeDeploymentStackVali { continue; } - templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property.Value, options); + templateLink = ArmDeploymentStackTemplateLink.DeserializeArmDeploymentStackTemplateLink(property.Value, options); continue; } if (property.NameEquals("validatedResources"u8)) @@ -205,7 +205,7 @@ internal static DeploymentStackValidateProperties DeserializeDeploymentStackVali } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackValidateProperties( + return new ArmDeploymentStackValidateProperties( actionOnUnmanage, correlationId, denySettings, @@ -393,9 +393,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -404,26 +404,26 @@ BinaryData IPersistableModel.Write(ModelReade case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support writing '{options.Format}' format."); } } - DeploymentStackValidateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackValidateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStackValidateProperties(document.RootElement, options); + return DeserializeArmDeploymentStackValidateProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.cs similarity index 85% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.cs index f3ec759d52759..47cf467e6df41 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// The Deployment stack validation result details. - public partial class DeploymentStackValidateProperties + public partial class ArmDeploymentStackValidateProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,14 +45,14 @@ public partial class DeploymentStackValidateProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeploymentStackValidateProperties() + /// Initializes a new instance of . + public ArmDeploymentStackValidateProperties() { Parameters = new ChangeTrackingDictionary(); ValidatedResources = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. /// The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. /// The Deployment stack deny settings. @@ -62,7 +62,7 @@ public DeploymentStackValidateProperties() /// The URI of the template. /// The array of resources that were validated. /// Keeps track of any properties unknown to the library. - internal DeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, string correlationId, DenySettings denySettings, string deploymentScope, string description, IDictionary parameters, DeploymentStacksTemplateLink templateLink, IList validatedResources, IDictionary serializedAdditionalRawData) + internal ArmDeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, string correlationId, DenySettings denySettings, string deploymentScope, string description, IDictionary parameters, ArmDeploymentStackTemplateLink templateLink, IList validatedResources, IDictionary serializedAdditionalRawData) { ActionOnUnmanage = actionOnUnmanage; CorrelationId = correlationId; @@ -95,7 +95,7 @@ internal DeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, st public IDictionary Parameters { get; } /// The URI of the template. [WirePath("templateLink")] - public DeploymentStacksTemplateLink TemplateLink { get; set; } + public ArmDeploymentStackTemplateLink TemplateLink { get; set; } /// The array of resources that were validated. [WirePath("validatedResources")] public IList ValidatedResources { get; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.Serialization.cs similarity index 80% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.Serialization.cs index 1656965c7f31d..be056bdb67eaf 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class DeploymentStackValidateResult : IUtf8JsonSerializable, IJsonModel + public partial class ArmDeploymentStackValidateResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -76,19 +76,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndObject(); } - DeploymentStackValidateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ArmDeploymentStackValidateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeDeploymentStackValidateResult(document.RootElement, options); + return DeserializeArmDeploymentStackValidateResult(document.RootElement, options); } - internal static DeploymentStackValidateResult DeserializeDeploymentStackValidateResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ArmDeploymentStackValidateResult DeserializeArmDeploymentStackValidateResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -96,7 +96,7 @@ internal static DeploymentStackValidateResult DeserializeDeploymentStackValidate { return null; } - DeploymentStackValidateProperties properties = default; + ArmDeploymentStackValidateProperties properties = default; ResponseError error = default; ResourceIdentifier id = default; string name = default; @@ -112,7 +112,7 @@ internal static DeploymentStackValidateResult DeserializeDeploymentStackValidate { continue; } - properties = DeploymentStackValidateProperties.DeserializeDeploymentStackValidateProperties(property.Value, options); + properties = ArmDeploymentStackValidateProperties.DeserializeArmDeploymentStackValidateProperties(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -154,7 +154,7 @@ internal static DeploymentStackValidateResult DeserializeDeploymentStackValidate } } serializedAdditionalRawData = rawDataDictionary; - return new DeploymentStackValidateResult( + return new ArmDeploymentStackValidateResult( id, name, type, @@ -262,9 +262,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -273,26 +273,26 @@ BinaryData IPersistableModel.Write(ModelReaderWri case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support writing '{options.Format}' format."); } } - DeploymentStackValidateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ArmDeploymentStackValidateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeDeploymentStackValidateResult(document.RootElement, options); + return DeserializeArmDeploymentStackValidateResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.cs similarity index 78% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.cs index cb00b8393f8be..8dcb48ab25b48 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.Resources.Models { /// The Deployment stack validation result. - public partial class DeploymentStackValidateResult : ResourceData + public partial class ArmDeploymentStackValidateResult : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -47,12 +47,12 @@ public partial class DeploymentStackValidateResult : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public DeploymentStackValidateResult() + /// Initializes a new instance of . + public ArmDeploymentStackValidateResult() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -60,7 +60,7 @@ public DeploymentStackValidateResult() /// The validation result details. /// The error detail. /// Keeps track of any properties unknown to the library. - internal DeploymentStackValidateResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeploymentStackValidateProperties properties, ResponseError error, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ArmDeploymentStackValidateResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ArmDeploymentStackValidateProperties properties, ResponseError error, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; Error = error; @@ -69,7 +69,7 @@ internal DeploymentStackValidateResult(ResourceIdentifier id, string name, Resou /// The validation result details. [WirePath("properties")] - public DeploymentStackValidateProperties Properties { get; set; } + public ArmDeploymentStackValidateProperties Properties { get; set; } /// The error detail. [WirePath("error")] public ResponseError Error { get; set; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs deleted file mode 100644 index b59810cebb3b7..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Resources.Models -{ - /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. - public readonly partial struct DeploymentStacksDeleteDetachEnum : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DeploymentStacksDeleteDetachEnum(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeleteValue = "delete"; - private const string DetachValue = "detach"; - - /// delete. - public static DeploymentStacksDeleteDetachEnum Delete { get; } = new DeploymentStacksDeleteDetachEnum(DeleteValue); - /// detach. - public static DeploymentStacksDeleteDetachEnum Detach { get; } = new DeploymentStacksDeleteDetachEnum(DetachValue); - /// Determines if two values are the same. - public static bool operator ==(DeploymentStacksDeleteDetachEnum left, DeploymentStacksDeleteDetachEnum right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DeploymentStacksDeleteDetachEnum left, DeploymentStacksDeleteDetachEnum right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DeploymentStacksDeleteDetachEnum(string value) => new DeploymentStacksDeleteDetachEnum(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DeploymentStacksDeleteDetachEnum other && Equals(other); - /// - public bool Equals(DeploymentStacksDeleteDetachEnum other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs index cfb34097d3b8d..368b5958f6c7f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -74,7 +74,7 @@ internal Core.HttpMessage CreateExportTemplateAtScopeRequest(string scope, strin /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ExportTemplateAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public async Task> ExportTemplateAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -85,9 +85,9 @@ public async Task> ExportTemplateAtS { case 200: { - DeploymentStackTemplateDefinition value = default; + ArmDeploymentStackTemplateDefinition value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentStackTemplateDefinition.DeserializeDeploymentStackTemplateDefinition(document.RootElement); + value = ArmDeploymentStackTemplateDefinition.DeserializeArmDeploymentStackTemplateDefinition(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -101,7 +101,7 @@ public async Task> ExportTemplateAtS /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ExportTemplateAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public Response ExportTemplateAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -112,9 +112,9 @@ public Response ExportTemplateAtScope(string { case 200: { - DeploymentStackTemplateDefinition value = default; + ArmDeploymentStackTemplateDefinition value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentStackTemplateDefinition.DeserializeDeploymentStackTemplateDefinition(document.RootElement); + value = ArmDeploymentStackTemplateDefinition.DeserializeArmDeploymentStackTemplateDefinition(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -242,7 +242,7 @@ internal Core.HttpMessage CreateListAtScopeRequest(string scope) /// The resource scope. /// The cancellation token to use. /// is null. - public async Task> ListAtScopeAsync(string scope, CancellationToken cancellationToken = default) + public async Task> ListAtScopeAsync(string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); @@ -252,9 +252,9 @@ public async Task> ListAtScopeAsync(string s { case 200: { - DeploymentStackListResult value = default; + ArmDeploymentStackListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -266,7 +266,7 @@ public async Task> ListAtScopeAsync(string s /// The resource scope. /// The cancellation token to use. /// is null. - public Response ListAtScope(string scope, CancellationToken cancellationToken = default) + public Response ListAtScope(string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); @@ -276,9 +276,9 @@ public Response ListAtScope(string scope, Cancellatio { case 200: { - DeploymentStackListResult value = default; + ArmDeploymentStackListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -603,7 +603,7 @@ internal Core.HttpMessage CreateListAtScopeNextPageRequest(string nextLink, stri /// The resource scope. /// The cancellation token to use. /// or is null. - public async Task> ListAtScopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) + public async Task> ListAtScopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(scope, nameof(scope)); @@ -614,9 +614,9 @@ public async Task> ListAtScopeNextPageAsync( { case 200: { - DeploymentStackListResult value = default; + ArmDeploymentStackListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -629,7 +629,7 @@ public async Task> ListAtScopeNextPageAsync( /// The resource scope. /// The cancellation token to use. /// or is null. - public Response ListAtScopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) + public Response ListAtScopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(scope, nameof(scope)); @@ -640,9 +640,9 @@ public Response ListAtScopeNextPage(string nextLink, { case 200: { - DeploymentStackListResult value = default; + ArmDeploymentStackListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); + value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index d641cd0210f2f..e1732611380f9 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -26,7 +26,18 @@ enable-bicep-serialization: true # show-serialized-names: true rename-mapping: + # Deployment Stack Renames DeploymentStack: ArmDeploymentStack + DeploymentStackListResult: ArmDeploymentStackListResult + DeploymentStackProvisioingState: ArmDeploymentStackProvisioningState + DeploymentStackTemplateDefinition: ArmDeploymentStackTemplateDefinition + DeploymentStackValidateProperties: ArmDeploymentStackValidateProperties + DeploymentStackValidateResult: ArmDeploymentStackValidateResult + DeploymentStacksDebugSetting: ArmDeploymentStackDebugSetting + DeploymentStacksDeleteDetachEnum: ArmDeploymentStackDeleteDetachEnum + DeploymentStacksParametersLink: ArmDeploymentStackParametersLink + DeploymentStacksTemplateLink: ArmDeploymentStackTemplateLink + DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index 72b033fef1112..3a0b4e81eaf33 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -78,7 +78,7 @@ public async Task ValidateRG() var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + ArmDeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; Assert.IsNotNull(deploymentStackValidateResult); await rg.DeleteAsync(WaitUntil.Completed); @@ -130,7 +130,7 @@ public async Task ValidateSub() var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + ArmDeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; Assert.NotNull(deploymentStackValidateResult); } @@ -180,7 +180,7 @@ public async Task ValidateMG() var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + ArmDeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; Assert.IsNotNull(deploymentStackValidateResult); } } From 56ba081567c6d877616689185582a78100b4274b Mon Sep 17 00:00:00 2001 From: Dante DG Date: Fri, 28 Jun 2024 09:57:05 -0400 Subject: [PATCH 16/19] reverting some naming changes --- .../src/Custom/ArmDeploymentStackData.cs | 2 +- ...rmDeploymentStackResource.Serialization.cs | 26 --- .../src/Generated/ArmResourcesModelFactory.cs | 26 +-- ...ection.cs => DeploymentStackCollection.cs} | 130 ++++++------ ...s => DeploymentStackData.Serialization.cs} | 50 ++--- ...entStackData.cs => DeploymentStackData.cs} | 20 +- .../DeploymentStackResource.Serialization.cs | 26 +++ ...Resource.cs => DeploymentStackResource.cs} | 190 +++++++++--------- .../Extensions/MockableResourcesArmClient.cs | 12 +- ...ockableResourcesManagementGroupResource.cs | 20 +- .../MockableResourcesResourceGroupResource.cs | 20 +- .../MockableResourcesSubscriptionResource.cs | 20 +- .../Extensions/ResourcesExtensions.cs | 90 ++++----- .../ArmDeploymentStackOperationSource.cs | 38 ---- ...ymentStackValidateResultOperationSource.cs | 30 --- .../DeploymentStackOperationSource.cs | 38 ++++ ...ymentStackValidateResultOperationSource.cs | 30 +++ .../Models/ActionOnUnmanage.Serialization.cs | 12 +- .../src/Generated/Models/ActionOnUnmanage.cs | 10 +- .../ArmDeploymentStackDeleteDetachEnum.cs | 51 ----- ...eploymentStackListResult.Serialization.cs} | 44 ++-- ...Result.cs => DeploymentStackListResult.cs} | 14 +- ...tStackTemplateDefinition.Serialization.cs} | 42 ++-- ...s => DeploymentStackTemplateDefinition.cs} | 12 +- ...tStackValidateProperties.Serialization.cs} | 42 ++-- ...s => DeploymentStackValidateProperties.cs} | 12 +- ...ymentStackValidateResult.Serialization.cs} | 42 ++-- ...lt.cs => DeploymentStackValidateResult.cs} | 12 +- ...oymentStacksDebugSetting.Serialization.cs} | 38 ++-- ...ing.cs => DeploymentStacksDebugSetting.cs} | 10 +- .../DeploymentStacksDeleteDetachEnum.cs | 51 +++++ ...mentStacksParametersLink.Serialization.cs} | 38 ++-- ...k.cs => DeploymentStacksParametersLink.cs} | 14 +- ...oymentStacksTemplateLink.Serialization.cs} | 38 ++-- ...ink.cs => DeploymentStacksTemplateLink.cs} | 10 +- .../DeploymentStacksRestOperations.cs | 68 +++---- .../src/autorest.md | 12 -- .../tests/ResourcesTestBase.cs | 12 +- .../DeploymentStackCollectionTests.cs | 32 +-- .../DeploymentStackOperationsTests.cs | 24 +-- 40 files changed, 698 insertions(+), 710 deletions(-) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackCollection.cs => DeploymentStackCollection.cs} (65%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackData.Serialization.cs => DeploymentStackData.Serialization.cs} (94%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackData.cs => DeploymentStackData.cs} (90%) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/{ArmDeploymentStackResource.cs => DeploymentStackResource.cs} (71%) delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs delete mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackListResult.Serialization.cs => DeploymentStackListResult.Serialization.cs} (72%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackListResult.cs => DeploymentStackListResult.cs} (78%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackTemplateDefinition.Serialization.cs => DeploymentStackTemplateDefinition.Serialization.cs} (70%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackTemplateDefinition.cs => DeploymentStackTemplateDefinition.cs} (87%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackValidateProperties.Serialization.cs => DeploymentStackValidateProperties.Serialization.cs} (86%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackValidateProperties.cs => DeploymentStackValidateProperties.cs} (85%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackValidateResult.Serialization.cs => DeploymentStackValidateResult.Serialization.cs} (80%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackValidateResult.cs => DeploymentStackValidateResult.cs} (78%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackDebugSetting.Serialization.cs => DeploymentStacksDebugSetting.Serialization.cs} (69%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackDebugSetting.cs => DeploymentStacksDebugSetting.cs} (87%) create mode 100644 sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackParametersLink.Serialization.cs => DeploymentStacksParametersLink.Serialization.cs} (72%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackParametersLink.cs => DeploymentStacksParametersLink.cs} (80%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackTemplateLink.Serialization.cs => DeploymentStacksTemplateLink.Serialization.cs} (82%) rename sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/{ArmDeploymentStackTemplateLink.cs => DeploymentStacksTemplateLink.cs} (88%) diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs index 0f04c58e9d4f0..9bad31a6e1884 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources /// A class representing the ArmDeploymentStack data model. /// Deployment stack object. /// - public partial class ArmDeploymentStackData : ResourceData + public partial class DeploymentStackData : ResourceData { } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs deleted file mode 100644 index 2e805f382e98a..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Resources -{ - public partial class ArmDeploymentStackResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs index 8645b2dd2c9ab..67a07cb580496 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmResourcesModelFactory.cs @@ -850,16 +850,16 @@ public static DecompiledFileDefinition DecompiledFileDefinition(string path = nu return new DecompiledFileDefinition(path, contents, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. - /// A new instance for mocking. - public static ArmDeploymentStackTemplateDefinition ArmDeploymentStackTemplateDefinition(BinaryData template = null, ArmDeploymentStackTemplateLink templateLink = null) + /// A new instance for mocking. + public static DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(BinaryData template = null, DeploymentStacksTemplateLink templateLink = null) { - return new ArmDeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); + return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -886,8 +886,8 @@ public static ArmDeploymentStackTemplateDefinition ArmDeploymentStackTemplateDef /// The resourceId of the deployment resource created by the deployment stack. /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. - /// A new instance for mocking. - public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, ArmDeploymentStackTemplateLink templateLink = null, IDictionary parameters = null, ArmDeploymentStackParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) + /// A new instance for mocking. + public static DeploymentStackData DeploymentStackData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary tags = null, ResponseError error = null, BinaryData template = null, DeploymentStacksTemplateLink templateLink = null, IDictionary parameters = null, DeploymentStacksParametersLink parametersLink = null, ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = null, string deploymentScope = null, string description = null, DenySettings denySettings = null, DeploymentStackProvisioningState? provisioningState = null, string correlationId = null, IEnumerable detachedResources = null, IEnumerable deletedResources = null, IEnumerable failedResources = null, IEnumerable resources = null, string deploymentId = null, BinaryData outputs = null, TimeSpan? duration = null) { tags ??= new Dictionary(); parameters ??= new Dictionary(); @@ -896,7 +896,7 @@ public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier i failedResources ??= new List(); resources ??= new List(); - return new ArmDeploymentStackData( + return new DeploymentStackData( id, name, resourceType, @@ -909,7 +909,7 @@ public static ArmDeploymentStackData ArmDeploymentStackData(ResourceIdentifier i parameters, parametersLink, actionOnUnmanage, - debugSettingDetailLevel != null ? new ArmDeploymentStackDebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, + debugSettingDetailLevel != null ? new DeploymentStacksDebugSetting(debugSettingDetailLevel, serializedAdditionalRawData: null) : null, bypassStackOutOfSyncError, deploymentScope, description, @@ -953,17 +953,17 @@ public static ManagedResourceReference ManagedResourceReference(string id = null return new ManagedResourceReference(id, serializedAdditionalRawData: null, status, denyStatus); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The validation result details. /// The error detail. - /// A new instance for mocking. - public static ArmDeploymentStackValidateResult ArmDeploymentStackValidateResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ArmDeploymentStackValidateProperties properties = null, ResponseError error = null) + /// A new instance for mocking. + public static DeploymentStackValidateResult DeploymentStackValidateResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DeploymentStackValidateProperties properties = null, ResponseError error = null) { - return new ArmDeploymentStackValidateResult( + return new DeploymentStackValidateResult( id, name, resourceType, diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs similarity index 65% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs index a55017a317fbd..df33115caa974 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackCollection.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of , or . - /// To get an instance call the GetArmDeploymentStacks method from an instance of , or . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of , or . + /// To get a instance call the GetDeploymentStacks method from an instance of , or . /// - public partial class ArmDeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class DeploymentStackCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; - private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; + private readonly ClientDiagnostics _deploymentStackClientDiagnostics; + private readonly DeploymentStacksRestOperations _deploymentStackRestClient; - /// Initializes a new instance of the class for mocking. - protected ArmDeploymentStackCollection() + /// Initializes a new instance of the class for mocking. + protected DeploymentStackCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DeploymentStackCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ArmDeploymentStackResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ArmDeploymentStackResource.ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); - _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); + _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", DeploymentStackResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeploymentStackResource.ResourceType, out string deploymentStackApiVersion); + _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); } /// @@ -59,7 +59,7 @@ internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : /// /// /// Resource - /// + /// /// /// /// @@ -69,17 +69,17 @@ internal ArmDeploymentStackCollection(ArmClient client, ResourceIdentifier id) : /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id, deploymentStackName, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -108,7 +108,7 @@ public virtual async Task> CreateOrUpda /// /// /// Resource - /// + /// /// /// /// @@ -118,17 +118,17 @@ public virtual async Task> CreateOrUpda /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.CreateOrUpdate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.CreateOrUpdate"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id, deploymentStackName, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id, deploymentStackName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -157,7 +157,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Resource - /// + /// /// /// /// @@ -165,18 +165,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -202,7 +202,7 @@ public virtual async Task> GetAsync(string /// /// /// Resource - /// + /// /// /// /// @@ -210,18 +210,18 @@ public virtual async Task> GetAsync(string /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response Get(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Get"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -247,17 +247,17 @@ public virtual Response Get(string deploymentStackNa /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -277,17 +277,17 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _armDeploymentStackDeploymentStacksRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ArmDeploymentStackResource(Client, ArmDeploymentStackData.DeserializeArmDeploymentStackData(e)), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, "ArmDeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _deploymentStackRestClient.CreateListAtScopeRequest(Id); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deploymentStackRestClient.CreateListAtScopeNextPageRequest(nextLink, Id); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeploymentStackResource(Client, DeploymentStackData.DeserializeDeploymentStackData(e)), _deploymentStackClientDiagnostics, Pipeline, "DeploymentStackCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -307,7 +307,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Resource - /// + /// /// /// /// @@ -319,11 +319,11 @@ public virtual async Task> ExistsAsync(string deploymentStackName { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -350,7 +350,7 @@ public virtual async Task> ExistsAsync(string deploymentStackName /// /// /// Resource - /// + /// /// /// /// @@ -362,11 +362,11 @@ public virtual Response Exists(string deploymentStackName, CancellationTok { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.Exists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.Exists"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -393,7 +393,7 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// /// /// Resource - /// + /// /// /// /// @@ -401,18 +401,18 @@ public virtual Response Exists(string deploymentStackName, CancellationTok /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id, deploymentStackName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -438,7 +438,7 @@ public virtual async Task> GetIfExi /// /// /// Resource - /// + /// /// /// /// @@ -446,18 +446,18 @@ public virtual async Task> GetIfExi /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackCollection.GetIfExists"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackCollection.GetIfExists"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id, deploymentStackName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -466,7 +466,7 @@ public virtual NullableResponse GetIfExists(string d } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -476,7 +476,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs similarity index 94% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs index 0b2d2f720cff6..b87a44ec0eb74 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.Serialization.cs @@ -17,16 +17,16 @@ namespace Azure.ResourceManager.Resources { - public partial class ArmDeploymentStackData : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStackData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -227,19 +227,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteEndObject(); } - ArmDeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackData(document.RootElement, options); + return DeserializeDeploymentStackData(document.RootElement, options); } - internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStackData DeserializeDeploymentStackData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -255,11 +255,11 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle SystemData systemData = default; ResponseError error = default; BinaryData template = default; - ArmDeploymentStackTemplateLink templateLink = default; + DeploymentStacksTemplateLink templateLink = default; IDictionary parameters = default; - ArmDeploymentStackParametersLink parametersLink = default; + DeploymentStacksParametersLink parametersLink = default; ActionOnUnmanage actionOnUnmanage = default; - ArmDeploymentStackDebugSetting debugSetting = default; + DeploymentStacksDebugSetting debugSetting = default; bool? bypassStackOutOfSyncError = default; string deploymentScope = default; string description = default; @@ -357,7 +357,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { continue; } - templateLink = ArmDeploymentStackTemplateLink.DeserializeArmDeploymentStackTemplateLink(property0.Value, options); + templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property0.Value, options); continue; } if (property0.NameEquals("parameters"u8)) @@ -380,7 +380,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { continue; } - parametersLink = ArmDeploymentStackParametersLink.DeserializeArmDeploymentStackParametersLink(property0.Value, options); + parametersLink = DeploymentStacksParametersLink.DeserializeDeploymentStacksParametersLink(property0.Value, options); continue; } if (property0.NameEquals("actionOnUnmanage"u8)) @@ -398,7 +398,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle { continue; } - debugSetting = ArmDeploymentStackDebugSetting.DeserializeArmDeploymentStackDebugSetting(property0.Value, options); + debugSetting = DeploymentStacksDebugSetting.DeserializeDeploymentStacksDebugSetting(property0.Value, options); continue; } if (property0.NameEquals("bypassStackOutOfSyncError"u8)) @@ -531,7 +531,7 @@ internal static ArmDeploymentStackData DeserializeArmDeploymentStackData(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackData( + return new DeploymentStackData( id, name, type, @@ -1064,9 +1064,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -1075,26 +1075,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackData(document.RootElement, options); + return DeserializeDeploymentStackData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs similarity index 90% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs index cfa01e0b530bd..4078243e51012 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackData.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.Resources { /// - /// A class representing the ArmDeploymentStack data model. + /// A class representing the DeploymentStack data model. /// Deployment stack object. /// - public partial class ArmDeploymentStackData : ResourceData + public partial class DeploymentStackData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,8 +51,8 @@ public partial class ArmDeploymentStackData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ArmDeploymentStackData() + /// Initializes a new instance of . + public DeploymentStackData() { Tags = new ChangeTrackingDictionary(); Parameters = new ChangeTrackingDictionary(); @@ -62,7 +62,7 @@ public ArmDeploymentStackData() Resources = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -90,7 +90,7 @@ public ArmDeploymentStackData() /// The outputs of the deployment resource created by the deployment stack. /// The duration of the last successful Deployment stack update. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, ArmDeploymentStackTemplateLink templateLink, IDictionary parameters, ArmDeploymentStackParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, ArmDeploymentStackDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DeploymentStackData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary tags, ResponseError error, BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary parameters, DeploymentStacksParametersLink parametersLink, ActionOnUnmanage actionOnUnmanage, DeploymentStacksDebugSetting debugSetting, bool? bypassStackOutOfSyncError, string deploymentScope, string description, DenySettings denySettings, DeploymentStackProvisioningState? provisioningState, string correlationId, IReadOnlyList detachedResources, IReadOnlyList deletedResources, IReadOnlyList failedResources, IReadOnlyList resources, string deploymentId, BinaryData outputs, TimeSpan? duration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Location = location; Tags = tags; @@ -160,18 +160,18 @@ internal ArmDeploymentStackData(ResourceIdentifier id, string name, ResourceType public BinaryData Template { get; set; } /// The URI of the template. Use either the templateLink property or the template property, but not both. [WirePath("properties.templateLink")] - public ArmDeploymentStackTemplateLink TemplateLink { get; set; } + public DeploymentStacksTemplateLink TemplateLink { get; set; } /// Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. [WirePath("properties.parameters")] public IDictionary Parameters { get; } /// The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. [WirePath("properties.parametersLink")] - public ArmDeploymentStackParametersLink ParametersLink { get; set; } + public DeploymentStacksParametersLink ParametersLink { get; set; } /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. [WirePath("properties.actionOnUnmanage")] public ActionOnUnmanage ActionOnUnmanage { get; set; } /// The debug setting of the deployment. - internal ArmDeploymentStackDebugSetting DebugSetting { get; set; } + internal DeploymentStacksDebugSetting DebugSetting { get; set; } /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. [WirePath("properties.debugSetting.detailLevel")] public string DebugSettingDetailLevel @@ -180,7 +180,7 @@ public string DebugSettingDetailLevel set { if (DebugSetting is null) - DebugSetting = new ArmDeploymentStackDebugSetting(); + DebugSetting = new DeploymentStacksDebugSetting(); DebugSetting.DetailLevel = value; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs new file mode 100644 index 0000000000000..fcb29ed47817c --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Resources +{ + public partial class DeploymentStackResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DeploymentStackData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DeploymentStackData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs similarity index 71% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs index e5774b039704c..94f9f1e5abac1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/ArmDeploymentStackResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/DeploymentStackResource.cs @@ -18,14 +18,14 @@ namespace Azure.ResourceManager.Resources { /// - /// A Class representing an ArmDeploymentStack along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetArmDeploymentStackResource method. - /// Otherwise you can get one from its parent resource , or using the GetArmDeploymentStack method. + /// A Class representing a DeploymentStack along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDeploymentStackResource method. + /// Otherwise you can get one from its parent resource , or using the GetDeploymentStack method. /// - public partial class ArmDeploymentStackResource : ArmResource + public partial class DeploymentStackResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The scope. /// The deploymentStackName. public static ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) @@ -34,35 +34,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string scope, string d return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _armDeploymentStackDeploymentStacksClientDiagnostics; - private readonly DeploymentStacksRestOperations _armDeploymentStackDeploymentStacksRestClient; - private readonly ArmDeploymentStackData _data; + private readonly ClientDiagnostics _deploymentStackClientDiagnostics; + private readonly DeploymentStacksRestOperations _deploymentStackRestClient; + private readonly DeploymentStackData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Resources/deploymentStacks"; - /// Initializes a new instance of the class for mocking. - protected ArmDeploymentStackResource() + /// Initializes a new instance of the class for mocking. + protected DeploymentStackResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ArmDeploymentStackResource(ArmClient client, ArmDeploymentStackData data) : this(client, data.Id) + internal DeploymentStackResource(ArmClient client, DeploymentStackData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal ArmDeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal DeploymentStackResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _armDeploymentStackDeploymentStacksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string armDeploymentStackDeploymentStacksApiVersion); - _armDeploymentStackDeploymentStacksRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, armDeploymentStackDeploymentStacksApiVersion); + _deploymentStackClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Resources", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deploymentStackApiVersion); + _deploymentStackRestClient = new DeploymentStacksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deploymentStackApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal ArmDeploymentStackResource(ArmClient client, ResourceIdentifier id) : b /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ArmDeploymentStackData Data + public virtual DeploymentStackData Data { get { @@ -106,21 +106,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -146,21 +146,21 @@ public virtual async Task> GetAsync(Cancell /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Get"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Get"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ArmDeploymentStackResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new DeploymentStackResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -186,7 +186,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -198,12 +198,12 @@ public virtual Response Get(CancellationToken cancel /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = await _deploymentStackRestClient.DeleteAtScopeAsync(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// /// /// Resource - /// + /// /// /// /// @@ -244,12 +244,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Unmanag /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMode? unmanageActionResources = null, UnmanageActionResourceGroupMode? unmanageActionResourceGroups = null, UnmanageActionManagementGroupMode? unmanageActionManagementGroups = null, bool? bypassStackOutOfSyncError = null, CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Delete"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Delete"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); - var operation = new ResourcesArmOperation(_armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); + var response = _deploymentStackRestClient.DeleteAtScope(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, cancellationToken); + var operation = new ResourcesArmOperation(_deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateDeleteAtScopeRequest(Id.Parent, Id.Name, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -278,7 +278,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// /// /// Resource - /// + /// /// /// /// @@ -286,16 +286,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, UnmanageActionResourceMo /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _deploymentStackRestClient.CreateOrUpdateAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -324,7 +324,7 @@ public virtual async Task> UpdateAsync( /// /// /// Resource - /// + /// /// /// /// @@ -332,16 +332,16 @@ public virtual async Task> UpdateAsync( /// Deployment stack supplied to the operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.Update"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.Update"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new ArmDeploymentStackOperationSource(Client), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _deploymentStackRestClient.CreateOrUpdateAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackOperationSource(Client), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateCreateOrUpdateAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -370,18 +370,18 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) + public virtual async Task> ExportTemplateAsync(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ExportTemplate"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _deploymentStackRestClient.ExportTemplateAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -408,18 +408,18 @@ public virtual async Task> Export /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response ExportTemplate(CancellationToken cancellationToken = default) + public virtual Response ExportTemplate(CancellationToken cancellationToken = default) { - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ExportTemplate"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ExportTemplate"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); + var response = _deploymentStackRestClient.ExportTemplateAtScope(Id.Parent, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -446,7 +446,7 @@ public virtual Response ExportTemplate(Can /// /// /// Resource - /// + /// /// /// /// @@ -454,16 +454,16 @@ public virtual Response ExportTemplate(Can /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual async Task> ValidateStackAsync(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = await _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ResourcesArmOperation(new ArmDeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _deploymentStackRestClient.ValidateStackAtScopeAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -492,7 +492,7 @@ public virtual async Task> Valida /// /// /// Resource - /// + /// /// /// /// @@ -500,16 +500,16 @@ public virtual async Task> Valida /// Deployment stack to validate. /// The cancellation token to use. /// is null. - public virtual ArmOperation ValidateStack(WaitUntil waitUntil, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateStack(WaitUntil waitUntil, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.ValidateStack"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.ValidateStack"); scope.Start(); try { - var response = _armDeploymentStackDeploymentStacksRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); - var operation = new ResourcesArmOperation(new ArmDeploymentStackValidateResultOperationSource(), _armDeploymentStackDeploymentStacksClientDiagnostics, Pipeline, _armDeploymentStackDeploymentStacksRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _deploymentStackRestClient.ValidateStackAtScope(Id.Parent, Id.Name, data, cancellationToken); + var operation = new ResourcesArmOperation(new DeploymentStackValidateResultOperationSource(), _deploymentStackClientDiagnostics, Pipeline, _deploymentStackRestClient.CreateValidateStackAtScopeRequest(Id.Parent, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -538,7 +538,7 @@ public virtual ArmOperation ValidateStack(Wait /// /// /// Resource - /// + /// /// /// /// @@ -546,12 +546,12 @@ public virtual ArmOperation ValidateStack(Wait /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); scope.Start(); try { @@ -560,8 +560,8 @@ public virtual async Task> AddTagAsync(stri var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -595,7 +595,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Resource - /// + /// /// /// /// @@ -603,12 +603,12 @@ public virtual async Task> AddTagAsync(stri /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.AddTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.AddTag"); scope.Start(); try { @@ -617,8 +617,8 @@ public virtual Response AddTag(string key, string va var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -652,18 +652,18 @@ public virtual Response AddTag(string key, string va /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); scope.Start(); try { @@ -673,8 +673,8 @@ public virtual async Task> SetTagsAsync(IDi var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -708,18 +708,18 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.SetTags"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.SetTags"); scope.Start(); try { @@ -729,8 +729,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -784,8 +784,8 @@ public virtual async Task> RemoveTagAsync(s var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _armDeploymentStackDeploymentStacksRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _deploymentStackRestClient.GetAtScopeAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -819,18 +819,18 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _armDeploymentStackDeploymentStacksClientDiagnostics.CreateScope("ArmDeploymentStackResource.RemoveTag"); + using var scope = _deploymentStackClientDiagnostics.CreateScope("DeploymentStackResource.RemoveTag"); scope.Start(); try { @@ -839,8 +839,8 @@ public virtual Response RemoveTag(string key, Cancel var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _armDeploymentStackDeploymentStacksRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); - return Response.FromValue(new ArmDeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _deploymentStackRestClient.GetAtScope(Id.Parent, Id.Name, cancellationToken); + return Response.FromValue(new DeploymentStackResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs index 7cb4018edec2c..3e29a2690d062 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesArmClient.cs @@ -131,15 +131,15 @@ public virtual JitRequestResource GetJitRequestResource(ResourceIdentifier id) } /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual ArmDeploymentStackResource GetArmDeploymentStackResource(ResourceIdentifier id) + /// Returns a object. + public virtual DeploymentStackResource GetDeploymentStackResource(ResourceIdentifier id) { - ArmDeploymentStackResource.ValidateResourceId(id); - return new ArmDeploymentStackResource(Client, id); + DeploymentStackResource.ValidateResourceId(id); + return new DeploymentStackResource(Client, id); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs index c926e0688109e..db346608464c2 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesManagementGroupResource.cs @@ -102,11 +102,11 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } - /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + /// Gets a collection of DeploymentStackResources in the ManagementGroupResource. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks() { - return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + return GetCachedClient(client => new DeploymentStackCollection(client, Id)); } /// @@ -126,7 +126,7 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -135,9 +135,9 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -157,7 +157,7 @@ public virtual async Task> GetArmDeployment /// /// /// Resource - /// + /// /// /// /// @@ -166,9 +166,9 @@ public virtual async Task> GetArmDeployment /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs index 47d777db12ea9..6bdcc9a0735a1 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesResourceGroupResource.cs @@ -450,11 +450,11 @@ public virtual Response GetJitRequest(string jitRequestName, return GetJitRequests().Get(jitRequestName, cancellationToken); } - /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + /// Gets a collection of DeploymentStackResources in the ResourceGroupResource. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks() { - return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + return GetCachedClient(client => new DeploymentStackCollection(client, Id)); } /// @@ -474,7 +474,7 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -483,9 +483,9 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -505,7 +505,7 @@ public virtual async Task> GetArmDeployment /// /// /// Resource - /// + /// /// /// /// @@ -514,9 +514,9 @@ public virtual async Task> GetArmDeployment /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs index 544b2a74bcd65..ea1f959ac617d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/MockableResourcesSubscriptionResource.cs @@ -127,11 +127,11 @@ public virtual Response GetArmDeployment(string deploymen return GetArmDeployments().Get(deploymentName, cancellationToken); } - /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() + /// Gets a collection of DeploymentStackResources in the SubscriptionResource. + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public virtual DeploymentStackCollection GetDeploymentStacks() { - return GetCachedClient(client => new ArmDeploymentStackCollection(client, Id)); + return GetCachedClient(client => new DeploymentStackCollection(client, Id)); } /// @@ -151,7 +151,7 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// /// /// Resource - /// + /// /// /// /// @@ -160,9 +160,9 @@ public virtual ArmDeploymentStackCollection GetArmDeploymentStacks() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetArmDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual async Task> GetDeploymentStackAsync(string deploymentStackName, CancellationToken cancellationToken = default) { - return await GetArmDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetDeploymentStacks().GetAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -182,7 +182,7 @@ public virtual async Task> GetArmDeployment /// /// /// Resource - /// + /// /// /// /// @@ -191,9 +191,9 @@ public virtual async Task> GetArmDeployment /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetArmDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) + public virtual Response GetDeploymentStack(string deploymentStackName, CancellationToken cancellationToken = default) { - return GetArmDeploymentStacks().Get(deploymentStackName, cancellationToken); + return GetDeploymentStacks().Get(deploymentStackName, cancellationToken); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs index f28b410fde80e..7ab531c5154d6 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Extensions/ResourcesExtensions.cs @@ -196,22 +196,22 @@ public static JitRequestResource GetJitRequestResource(this ArmClient client, Re } /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ArmDeploymentStackResource GetArmDeploymentStackResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static DeploymentStackResource GetDeploymentStackResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableResourcesArmClient(client).GetArmDeploymentStackResource(id); + return GetMockableResourcesArmClient(client).GetDeploymentStackResource(id); } /// @@ -308,20 +308,20 @@ public static Response GetArmDeployment(this ManagementGr } /// - /// Gets a collection of ArmDeploymentStackResources in the ManagementGroupResource. + /// Gets a collection of DeploymentStackResources in the ManagementGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ManagementGroupResource managementGroupResource) + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this ManagementGroupResource managementGroupResource) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStacks(); + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStacks(); } /// @@ -341,12 +341,12 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Managemen /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -355,11 +355,11 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Managemen /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetDeploymentStackAsync(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -379,12 +379,12 @@ public static async Task> GetArmDeploymentS /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -393,11 +393,11 @@ public static async Task> GetArmDeploymentS /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetDeploymentStack(this ManagementGroupResource managementGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(managementGroupResource, nameof(managementGroupResource)); - return GetMockableResourcesManagementGroupResource(managementGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesManagementGroupResource(managementGroupResource).GetDeploymentStack(deploymentStackName, cancellationToken); } /// @@ -961,20 +961,20 @@ public static Response GetJitRequest(this ResourceGroupResou } /// - /// Gets a collection of ArmDeploymentStackResources in the ResourceGroupResource. + /// Gets a collection of DeploymentStackResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStacks(); + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStacks(); } /// @@ -994,12 +994,12 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceG /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1008,11 +1008,11 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this ResourceG /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetDeploymentStackAsync(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -1032,12 +1032,12 @@ public static async Task> GetArmDeploymentS /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1046,11 +1046,11 @@ public static async Task> GetArmDeploymentS /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetDeploymentStack(this ResourceGroupResource resourceGroupResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesResourceGroupResource(resourceGroupResource).GetDeploymentStack(deploymentStackName, cancellationToken); } /// @@ -1147,20 +1147,20 @@ public static Response GetArmDeployment(this Subscription } /// - /// Gets a collection of ArmDeploymentStackResources in the SubscriptionResource. + /// Gets a collection of DeploymentStackResources in the SubscriptionResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of ArmDeploymentStackResources and their operations over a ArmDeploymentStackResource. - public static ArmDeploymentStackCollection GetArmDeploymentStacks(this SubscriptionResource subscriptionResource) + /// An object representing collection of DeploymentStackResources and their operations over a DeploymentStackResource. + public static DeploymentStackCollection GetDeploymentStacks(this SubscriptionResource subscriptionResource) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStacks(); + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStacks(); } /// @@ -1180,12 +1180,12 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Subscript /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1194,11 +1194,11 @@ public static ArmDeploymentStackCollection GetArmDeploymentStacks(this Subscript /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetArmDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static async Task> GetDeploymentStackAsync(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); + return await GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStackAsync(deploymentStackName, cancellationToken).ConfigureAwait(false); } /// @@ -1218,12 +1218,12 @@ public static async Task> GetArmDeploymentS /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -1232,11 +1232,11 @@ public static async Task> GetArmDeploymentS /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetArmDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) + public static Response GetDeploymentStack(this SubscriptionResource subscriptionResource, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableResourcesSubscriptionResource(subscriptionResource).GetArmDeploymentStack(deploymentStackName, cancellationToken); + return GetMockableResourcesSubscriptionResource(subscriptionResource).GetDeploymentStack(deploymentStackName, cancellationToken); } /// diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs deleted file mode 100644 index 470c7cbd2de4e..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.Resources -{ - internal class ArmDeploymentStackOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ArmDeploymentStackOperationSource(ArmClient client) - { - _client = client; - } - - ArmDeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); - return new ArmDeploymentStackResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); - return new ArmDeploymentStackResource(_client, data); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs deleted file mode 100644 index 3bca451dfb406..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/ArmDeploymentStackValidateResultOperationSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.Resources -{ - internal class ArmDeploymentStackValidateResultOperationSource : IOperationSource - { - ArmDeploymentStackValidateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ArmDeploymentStackValidateResult.DeserializeArmDeploymentStackValidateResult(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ArmDeploymentStackValidateResult.DeserializeArmDeploymentStackValidateResult(document.RootElement); - } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs new file mode 100644 index 0000000000000..24d61a2df9aa0 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Resources +{ + internal class DeploymentStackOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DeploymentStackOperationSource(ArmClient client) + { + _client = client; + } + + DeploymentStackResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return new DeploymentStackResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); + return new DeploymentStackResource(_client, data); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs new file mode 100644 index 0000000000000..fbbceab1542f4 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/LongRunningOperation/DeploymentStackValidateResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Resources +{ + internal class DeploymentStackValidateResultOperationSource : IOperationSource + { + DeploymentStackValidateResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return DeploymentStackValidateResult.DeserializeDeploymentStackValidateResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return DeploymentStackValidateResult.DeserializeDeploymentStackValidateResult(document.RootElement); + } + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs index 79f631f68ac4e..fd97fd37c2ff5 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.Serialization.cs @@ -77,16 +77,16 @@ internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element { return null; } - ArmDeploymentStackDeleteDetachEnum resources = default; - ArmDeploymentStackDeleteDetachEnum? resourceGroups = default; - ArmDeploymentStackDeleteDetachEnum? managementGroups = default; + DeploymentStacksDeleteDetachEnum resources = default; + DeploymentStacksDeleteDetachEnum? resourceGroups = default; + DeploymentStacksDeleteDetachEnum? managementGroups = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("resources"u8)) { - resources = new ArmDeploymentStackDeleteDetachEnum(property.Value.GetString()); + resources = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); continue; } if (property.NameEquals("resourceGroups"u8)) @@ -95,7 +95,7 @@ internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element { continue; } - resourceGroups = new ArmDeploymentStackDeleteDetachEnum(property.Value.GetString()); + resourceGroups = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); continue; } if (property.NameEquals("managementGroups"u8)) @@ -104,7 +104,7 @@ internal static ActionOnUnmanage DeserializeActionOnUnmanage(JsonElement element { continue; } - managementGroups = new ArmDeploymentStackDeleteDetachEnum(property.Value.GetString()); + managementGroups = new DeploymentStacksDeleteDetachEnum(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs index d36f413bd9949..e5bfff9878bd2 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ActionOnUnmanage.cs @@ -47,7 +47,7 @@ public partial class ActionOnUnmanage /// Initializes a new instance of . /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. - public ActionOnUnmanage(ArmDeploymentStackDeleteDetachEnum resources) + public ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources) { Resources = resources; } @@ -57,7 +57,7 @@ public ActionOnUnmanage(ArmDeploymentStackDeleteDetachEnum resources) /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. /// Keeps track of any properties unknown to the library. - internal ActionOnUnmanage(ArmDeploymentStackDeleteDetachEnum resources, ArmDeploymentStackDeleteDetachEnum? resourceGroups, ArmDeploymentStackDeleteDetachEnum? managementGroups, IDictionary serializedAdditionalRawData) + internal ActionOnUnmanage(DeploymentStacksDeleteDetachEnum resources, DeploymentStacksDeleteDetachEnum? resourceGroups, DeploymentStacksDeleteDetachEnum? managementGroups, IDictionary serializedAdditionalRawData) { Resources = resources; ResourceGroups = resourceGroups; @@ -72,12 +72,12 @@ internal ActionOnUnmanage() /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. [WirePath("resources")] - public ArmDeploymentStackDeleteDetachEnum Resources { get; set; } + public DeploymentStacksDeleteDetachEnum Resources { get; set; } /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. [WirePath("resourceGroups")] - public ArmDeploymentStackDeleteDetachEnum? ResourceGroups { get; set; } + public DeploymentStacksDeleteDetachEnum? ResourceGroups { get; set; } /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. [WirePath("managementGroups")] - public ArmDeploymentStackDeleteDetachEnum? ManagementGroups { get; set; } + public DeploymentStacksDeleteDetachEnum? ManagementGroups { get; set; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs deleted file mode 100644 index e20bacab0e96b..0000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDeleteDetachEnum.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Resources.Models -{ - /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. - public readonly partial struct ArmDeploymentStackDeleteDetachEnum : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ArmDeploymentStackDeleteDetachEnum(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DeleteValue = "delete"; - private const string DetachValue = "detach"; - - /// delete. - public static ArmDeploymentStackDeleteDetachEnum Delete { get; } = new ArmDeploymentStackDeleteDetachEnum(DeleteValue); - /// detach. - public static ArmDeploymentStackDeleteDetachEnum Detach { get; } = new ArmDeploymentStackDeleteDetachEnum(DetachValue); - /// Determines if two values are the same. - public static bool operator ==(ArmDeploymentStackDeleteDetachEnum left, ArmDeploymentStackDeleteDetachEnum right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ArmDeploymentStackDeleteDetachEnum left, ArmDeploymentStackDeleteDetachEnum right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ArmDeploymentStackDeleteDetachEnum(string value) => new ArmDeploymentStackDeleteDetachEnum(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ArmDeploymentStackDeleteDetachEnum other && Equals(other); - /// - public bool Equals(ArmDeploymentStackDeleteDetachEnum other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs similarity index 72% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs index 8e85240412d9a..205eeb12438fe 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.Resources.Models { - internal partial class ArmDeploymentStackListResult : IUtf8JsonSerializable, IJsonModel + internal partial class DeploymentStackListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -61,19 +61,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteEndObject(); } - ArmDeploymentStackListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStackListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackListResult(document.RootElement, options); + return DeserializeDeploymentStackListResult(document.RootElement, options); } - internal static ArmDeploymentStackListResult DeserializeArmDeploymentStackListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStackListResult DeserializeDeploymentStackListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -81,7 +81,7 @@ internal static ArmDeploymentStackListResult DeserializeArmDeploymentStackListRe { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,10 +93,10 @@ internal static ArmDeploymentStackListResult DeserializeArmDeploymentStackListRe { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ArmDeploymentStackData.DeserializeArmDeploymentStackData(item, options)); + array.Add(DeploymentStackData.DeserializeDeploymentStackData(item, options)); } value = array; continue; @@ -112,7 +112,7 @@ internal static ArmDeploymentStackListResult DeserializeArmDeploymentStackListRe } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DeploymentStackListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -176,9 +176,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -187,26 +187,26 @@ BinaryData IPersistableModel.Write(ModelReaderWrit case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStackListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackListResult(document.RootElement, options); + return DeserializeDeploymentStackListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs similarity index 78% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs index 70c98f3dbfc20..8b6ba6dd33ca0 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackListResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackListResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// List of Deployment stacks. - internal partial class ArmDeploymentStackListResult + internal partial class DeploymentStackListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +45,17 @@ internal partial class ArmDeploymentStackListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ArmDeploymentStackListResult() + /// Initializes a new instance of . + internal DeploymentStackListResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// An array of Deployment stacks. /// The URL to use for getting the next set of results. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DeploymentStackListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal ArmDeploymentStackListResult(IReadOnlyList valu } /// An array of Deployment stacks. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The URL to use for getting the next set of results. public string NextLink { get; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs similarity index 70% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs index 17b096465819e..86e22ee4f18ac 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class ArmDeploymentStackTemplateDefinition : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStackTemplateDefinition : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -62,19 +62,19 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteEndObject(); } - ArmDeploymentStackTemplateDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStackTemplateDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackTemplateDefinition(document.RootElement, options); + return DeserializeDeploymentStackTemplateDefinition(document.RootElement, options); } - internal static ArmDeploymentStackTemplateDefinition DeserializeArmDeploymentStackTemplateDefinition(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStackTemplateDefinition DeserializeDeploymentStackTemplateDefinition(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +83,7 @@ internal static ArmDeploymentStackTemplateDefinition DeserializeArmDeploymentSta return null; } BinaryData template = default; - ArmDeploymentStackTemplateLink templateLink = default; + DeploymentStacksTemplateLink templateLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,7 +103,7 @@ internal static ArmDeploymentStackTemplateDefinition DeserializeArmDeploymentSta { continue; } - templateLink = ArmDeploymentStackTemplateLink.DeserializeArmDeploymentStackTemplateLink(property.Value, options); + templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property.Value, options); continue; } if (options.Format != "W") @@ -112,7 +112,7 @@ internal static ArmDeploymentStackTemplateDefinition DeserializeArmDeploymentSta } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData); + return new DeploymentStackTemplateDefinition(template, templateLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -160,9 +160,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -171,26 +171,26 @@ BinaryData IPersistableModel.Write(ModelRe case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackTemplateDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStackTemplateDefinition IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackTemplateDefinition(document.RootElement, options); + return DeserializeDeploymentStackTemplateDefinition(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateDefinition)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackTemplateDefinition)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs similarity index 87% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs index c4fd09a86305a..df86a78d43da0 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateDefinition.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackTemplateDefinition.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// Export Template specific properties of the Deployment stack. - public partial class ArmDeploymentStackTemplateDefinition + public partial class DeploymentStackTemplateDefinition { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class ArmDeploymentStackTemplateDefinition /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ArmDeploymentStackTemplateDefinition() + /// Initializes a new instance of . + internal DeploymentStackTemplateDefinition() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. /// The URI of the template. Use either the templateLink property or the template property, but not both. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackTemplateDefinition(BinaryData template, ArmDeploymentStackTemplateLink templateLink, IDictionary serializedAdditionalRawData) + internal DeploymentStackTemplateDefinition(BinaryData template, DeploymentStacksTemplateLink templateLink, IDictionary serializedAdditionalRawData) { Template = template; TemplateLink = templateLink; @@ -95,6 +95,6 @@ internal ArmDeploymentStackTemplateDefinition(BinaryData template, ArmDeployment public BinaryData Template { get; } /// The URI of the template. Use either the templateLink property or the template property, but not both. [WirePath("templateLink")] - public ArmDeploymentStackTemplateLink TemplateLink { get; } + public DeploymentStacksTemplateLink TemplateLink { get; } } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs similarity index 86% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs index 888c8a8254afd..42cf2b4ee0638 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class ArmDeploymentStackValidateProperties : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStackValidateProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -97,19 +97,19 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteEndObject(); } - ArmDeploymentStackValidateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStackValidateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackValidateProperties(document.RootElement, options); + return DeserializeDeploymentStackValidateProperties(document.RootElement, options); } - internal static ArmDeploymentStackValidateProperties DeserializeArmDeploymentStackValidateProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStackValidateProperties DeserializeDeploymentStackValidateProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -123,7 +123,7 @@ internal static ArmDeploymentStackValidateProperties DeserializeArmDeploymentSta string deploymentScope = default; string description = default; IDictionary parameters = default; - ArmDeploymentStackTemplateLink templateLink = default; + DeploymentStacksTemplateLink templateLink = default; IList validatedResources = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -182,7 +182,7 @@ internal static ArmDeploymentStackValidateProperties DeserializeArmDeploymentSta { continue; } - templateLink = ArmDeploymentStackTemplateLink.DeserializeArmDeploymentStackTemplateLink(property.Value, options); + templateLink = DeploymentStacksTemplateLink.DeserializeDeploymentStacksTemplateLink(property.Value, options); continue; } if (property.NameEquals("validatedResources"u8)) @@ -205,7 +205,7 @@ internal static ArmDeploymentStackValidateProperties DeserializeArmDeploymentSta } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackValidateProperties( + return new DeploymentStackValidateProperties( actionOnUnmanage, correlationId, denySettings, @@ -393,9 +393,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -404,26 +404,26 @@ BinaryData IPersistableModel.Write(ModelRe case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackValidateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStackValidateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackValidateProperties(document.RootElement, options); + return DeserializeDeploymentStackValidateProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs similarity index 85% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs index 47cf467e6df41..f3ec759d52759 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateProperties.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// The Deployment stack validation result details. - public partial class ArmDeploymentStackValidateProperties + public partial class DeploymentStackValidateProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,14 +45,14 @@ public partial class ArmDeploymentStackValidateProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ArmDeploymentStackValidateProperties() + /// Initializes a new instance of . + public DeploymentStackValidateProperties() { Parameters = new ChangeTrackingDictionary(); ValidatedResources = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. /// The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. /// The Deployment stack deny settings. @@ -62,7 +62,7 @@ public ArmDeploymentStackValidateProperties() /// The URI of the template. /// The array of resources that were validated. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, string correlationId, DenySettings denySettings, string deploymentScope, string description, IDictionary parameters, ArmDeploymentStackTemplateLink templateLink, IList validatedResources, IDictionary serializedAdditionalRawData) + internal DeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, string correlationId, DenySettings denySettings, string deploymentScope, string description, IDictionary parameters, DeploymentStacksTemplateLink templateLink, IList validatedResources, IDictionary serializedAdditionalRawData) { ActionOnUnmanage = actionOnUnmanage; CorrelationId = correlationId; @@ -95,7 +95,7 @@ internal ArmDeploymentStackValidateProperties(ActionOnUnmanage actionOnUnmanage, public IDictionary Parameters { get; } /// The URI of the template. [WirePath("templateLink")] - public ArmDeploymentStackTemplateLink TemplateLink { get; set; } + public DeploymentStacksTemplateLink TemplateLink { get; set; } /// The array of resources that were validated. [WirePath("validatedResources")] public IList ValidatedResources { get; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs similarity index 80% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs index be056bdb67eaf..1656965c7f31d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.Serialization.cs @@ -15,16 +15,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class ArmDeploymentStackValidateResult : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStackValidateResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -76,19 +76,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - ArmDeploymentStackValidateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStackValidateResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackValidateResult(document.RootElement, options); + return DeserializeDeploymentStackValidateResult(document.RootElement, options); } - internal static ArmDeploymentStackValidateResult DeserializeArmDeploymentStackValidateResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStackValidateResult DeserializeDeploymentStackValidateResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -96,7 +96,7 @@ internal static ArmDeploymentStackValidateResult DeserializeArmDeploymentStackVa { return null; } - ArmDeploymentStackValidateProperties properties = default; + DeploymentStackValidateProperties properties = default; ResponseError error = default; ResourceIdentifier id = default; string name = default; @@ -112,7 +112,7 @@ internal static ArmDeploymentStackValidateResult DeserializeArmDeploymentStackVa { continue; } - properties = ArmDeploymentStackValidateProperties.DeserializeArmDeploymentStackValidateProperties(property.Value, options); + properties = DeploymentStackValidateProperties.DeserializeDeploymentStackValidateProperties(property.Value, options); continue; } if (property.NameEquals("error"u8)) @@ -154,7 +154,7 @@ internal static ArmDeploymentStackValidateResult DeserializeArmDeploymentStackVa } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackValidateResult( + return new DeploymentStackValidateResult( id, name, type, @@ -262,9 +262,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -273,26 +273,26 @@ BinaryData IPersistableModel.Write(ModelReader case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackValidateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStackValidateResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackValidateResult(document.RootElement, options); + return DeserializeDeploymentStackValidateResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackValidateResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStackValidateResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs similarity index 78% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs index 8dcb48ab25b48..cb00b8393f8be 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackValidateResult.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStackValidateResult.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.Resources.Models { /// The Deployment stack validation result. - public partial class ArmDeploymentStackValidateResult : ResourceData + public partial class DeploymentStackValidateResult : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -47,12 +47,12 @@ public partial class ArmDeploymentStackValidateResult : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ArmDeploymentStackValidateResult() + /// Initializes a new instance of . + public DeploymentStackValidateResult() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -60,7 +60,7 @@ public ArmDeploymentStackValidateResult() /// The validation result details. /// The error detail. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackValidateResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ArmDeploymentStackValidateProperties properties, ResponseError error, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DeploymentStackValidateResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DeploymentStackValidateProperties properties, ResponseError error, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; Error = error; @@ -69,7 +69,7 @@ internal ArmDeploymentStackValidateResult(ResourceIdentifier id, string name, Re /// The validation result details. [WirePath("properties")] - public ArmDeploymentStackValidateProperties Properties { get; set; } + public DeploymentStackValidateProperties Properties { get; set; } /// The error detail. [WirePath("error")] public ResponseError Error { get; set; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs similarity index 69% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs index 244f809f5d800..a2c8a225d0952 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - internal partial class ArmDeploymentStackDebugSetting : IUtf8JsonSerializable, IJsonModel + internal partial class DeploymentStacksDebugSetting : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -50,19 +50,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - ArmDeploymentStackDebugSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStacksDebugSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackDebugSetting(document.RootElement, options); + return DeserializeDeploymentStacksDebugSetting(document.RootElement, options); } - internal static ArmDeploymentStackDebugSetting DeserializeArmDeploymentStackDebugSetting(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStacksDebugSetting DeserializeDeploymentStacksDebugSetting(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,7 +86,7 @@ internal static ArmDeploymentStackDebugSetting DeserializeArmDeploymentStackDebu } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackDebugSetting(detailLevel, serializedAdditionalRawData); + return new DeploymentStacksDebugSetting(detailLevel, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -127,9 +127,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -138,26 +138,26 @@ BinaryData IPersistableModel.Write(ModelReaderWr case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackDebugSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStacksDebugSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackDebugSetting(document.RootElement, options); + return DeserializeDeploymentStacksDebugSetting(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackDebugSetting)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksDebugSetting)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs similarity index 87% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs index 66ff2ee8b5887..b1c41ea88b884 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackDebugSetting.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDebugSetting.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// The debug setting. - internal partial class ArmDeploymentStackDebugSetting + internal partial class DeploymentStacksDebugSetting { /// /// Keeps track of any properties unknown to the library. @@ -45,15 +45,15 @@ internal partial class ArmDeploymentStackDebugSetting /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ArmDeploymentStackDebugSetting() + /// Initializes a new instance of . + public DeploymentStacksDebugSetting() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackDebugSetting(string detailLevel, IDictionary serializedAdditionalRawData) + internal DeploymentStacksDebugSetting(string detailLevel, IDictionary serializedAdditionalRawData) { DetailLevel = detailLevel; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs new file mode 100644 index 0000000000000..b59810cebb3b7 --- /dev/null +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksDeleteDetachEnum.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. + public readonly partial struct DeploymentStacksDeleteDetachEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeploymentStacksDeleteDetachEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "delete"; + private const string DetachValue = "detach"; + + /// delete. + public static DeploymentStacksDeleteDetachEnum Delete { get; } = new DeploymentStacksDeleteDetachEnum(DeleteValue); + /// detach. + public static DeploymentStacksDeleteDetachEnum Detach { get; } = new DeploymentStacksDeleteDetachEnum(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(DeploymentStacksDeleteDetachEnum left, DeploymentStacksDeleteDetachEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeploymentStacksDeleteDetachEnum left, DeploymentStacksDeleteDetachEnum right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DeploymentStacksDeleteDetachEnum(string value) => new DeploymentStacksDeleteDetachEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeploymentStacksDeleteDetachEnum other && Equals(other); + /// + public bool Equals(DeploymentStacksDeleteDetachEnum other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs similarity index 72% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs index 5c6cf6f1e9cd7..2f4566cc45368 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class ArmDeploymentStackParametersLink : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStacksParametersLink : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -52,19 +52,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } - ArmDeploymentStackParametersLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStacksParametersLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackParametersLink(document.RootElement, options); + return DeserializeDeploymentStacksParametersLink(document.RootElement, options); } - internal static ArmDeploymentStackParametersLink DeserializeArmDeploymentStackParametersLink(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStacksParametersLink DeserializeDeploymentStacksParametersLink(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -94,7 +94,7 @@ internal static ArmDeploymentStackParametersLink DeserializeArmDeploymentStackPa } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackParametersLink(uri, contentVersion, serializedAdditionalRawData); + return new DeploymentStacksParametersLink(uri, contentVersion, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -150,9 +150,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -161,26 +161,26 @@ BinaryData IPersistableModel.Write(ModelReader case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackParametersLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStacksParametersLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackParametersLink(document.RootElement, options); + return DeserializeDeploymentStacksParametersLink(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackParametersLink)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksParametersLink)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs similarity index 80% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs index f50264d6ea96c..72e7f5a22a7fa 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackParametersLink.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksParametersLink.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// Entity representing the reference to the deployment parameters. - public partial class ArmDeploymentStackParametersLink + public partial class DeploymentStacksParametersLink { /// /// Keeps track of any properties unknown to the library. @@ -45,29 +45,29 @@ public partial class ArmDeploymentStackParametersLink /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The URI of the parameters file. /// is null. - public ArmDeploymentStackParametersLink(Uri uri) + public DeploymentStacksParametersLink(Uri uri) { Argument.AssertNotNull(uri, nameof(uri)); Uri = uri; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The URI of the parameters file. /// If included, must match the ContentVersion in the template. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackParametersLink(Uri uri, string contentVersion, IDictionary serializedAdditionalRawData) + internal DeploymentStacksParametersLink(Uri uri, string contentVersion, IDictionary serializedAdditionalRawData) { Uri = uri; ContentVersion = contentVersion; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ArmDeploymentStackParametersLink() + /// Initializes a new instance of for deserialization. + internal DeploymentStacksParametersLink() { } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.Serialization.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs similarity index 82% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.Serialization.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs index 52240130d4122..dc4c06562d8df 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.Serialization.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.Serialization.cs @@ -14,16 +14,16 @@ namespace Azure.ResourceManager.Resources.Models { - public partial class ArmDeploymentStackTemplateLink : IUtf8JsonSerializable, IJsonModel + public partial class DeploymentStacksTemplateLink : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -70,19 +70,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } - ArmDeploymentStackTemplateLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + DeploymentStacksTemplateLink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeArmDeploymentStackTemplateLink(document.RootElement, options); + return DeserializeDeploymentStacksTemplateLink(document.RootElement, options); } - internal static ArmDeploymentStackTemplateLink DeserializeArmDeploymentStackTemplateLink(JsonElement element, ModelReaderWriterOptions options = null) + internal static DeploymentStacksTemplateLink DeserializeDeploymentStacksTemplateLink(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -134,7 +134,7 @@ internal static ArmDeploymentStackTemplateLink DeserializeArmDeploymentStackTemp } } serializedAdditionalRawData = rawDataDictionary; - return new ArmDeploymentStackTemplateLink( + return new DeploymentStacksTemplateLink( uri, id, relativePath, @@ -265,9 +265,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -276,26 +276,26 @@ BinaryData IPersistableModel.Write(ModelReaderWr case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support writing '{options.Format}' format."); } } - ArmDeploymentStackTemplateLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + DeploymentStacksTemplateLink IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeArmDeploymentStackTemplateLink(document.RootElement, options); + return DeserializeDeploymentStacksTemplateLink(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ArmDeploymentStackTemplateLink)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(DeploymentStacksTemplateLink)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs similarity index 88% rename from sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs index 071a62eb1a465..6da14d9e0ac6d 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentStackTemplateLink.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/DeploymentStacksTemplateLink.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Resources.Models { /// Entity representing the reference to the template. - public partial class ArmDeploymentStackTemplateLink + public partial class DeploymentStacksTemplateLink { /// /// Keeps track of any properties unknown to the library. @@ -45,19 +45,19 @@ public partial class ArmDeploymentStackTemplateLink /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ArmDeploymentStackTemplateLink() + /// Initializes a new instance of . + public DeploymentStacksTemplateLink() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The URI of the template to deploy. Use either the uri or id property, but not both. /// The resourceId of a Template Spec. Use either the id or uri property, but not both. /// The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs. /// The query string (for example, a SAS token) to be used with the templateLink URI. /// If included, must match the ContentVersion in the template. /// Keeps track of any properties unknown to the library. - internal ArmDeploymentStackTemplateLink(Uri uri, string id, string relativePath, string queryString, string contentVersion, IDictionary serializedAdditionalRawData) + internal DeploymentStacksTemplateLink(Uri uri, string id, string relativePath, string queryString, string contentVersion, IDictionary serializedAdditionalRawData) { Uri = uri; Id = id; diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs index 368b5958f6c7f..0169d77f4adea 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/RestOperations/DeploymentStacksRestOperations.cs @@ -74,7 +74,7 @@ internal Core.HttpMessage CreateExportTemplateAtScopeRequest(string scope, strin /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ExportTemplateAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public async Task> ExportTemplateAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -85,9 +85,9 @@ public async Task> ExportTemplate { case 200: { - ArmDeploymentStackTemplateDefinition value = default; + DeploymentStackTemplateDefinition value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDeploymentStackTemplateDefinition.DeserializeArmDeploymentStackTemplateDefinition(document.RootElement); + value = DeploymentStackTemplateDefinition.DeserializeDeploymentStackTemplateDefinition(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -101,7 +101,7 @@ public async Task> ExportTemplate /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ExportTemplateAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public Response ExportTemplateAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -112,9 +112,9 @@ public Response ExportTemplateAtScope(stri { case 200: { - ArmDeploymentStackTemplateDefinition value = default; + DeploymentStackTemplateDefinition value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDeploymentStackTemplateDefinition.DeserializeArmDeploymentStackTemplateDefinition(document.RootElement); + value = DeploymentStackTemplateDefinition.DeserializeDeploymentStackTemplateDefinition(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -122,7 +122,7 @@ public Response ExportTemplateAtScope(stri } } - internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -135,7 +135,7 @@ internal RequestUriBuilder CreateValidateStackAtScopeRequestUri(string scope, st return uri; } - internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -165,7 +165,7 @@ internal Core.HttpMessage CreateValidateStackAtScopeRequest(string scope, string /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public async Task ValidateStackAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -191,7 +191,7 @@ public async Task ValidateStackAtScopeAsync(string scope, string deplo /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response ValidateStackAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public Response ValidateStackAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -242,7 +242,7 @@ internal Core.HttpMessage CreateListAtScopeRequest(string scope) /// The resource scope. /// The cancellation token to use. /// is null. - public async Task> ListAtScopeAsync(string scope, CancellationToken cancellationToken = default) + public async Task> ListAtScopeAsync(string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); @@ -252,9 +252,9 @@ public async Task> ListAtScopeAsync(strin { case 200: { - ArmDeploymentStackListResult value = default; + DeploymentStackListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -266,7 +266,7 @@ public async Task> ListAtScopeAsync(strin /// The resource scope. /// The cancellation token to use. /// is null. - public Response ListAtScope(string scope, CancellationToken cancellationToken = default) + public Response ListAtScope(string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); @@ -276,9 +276,9 @@ public Response ListAtScope(string scope, Cancella { case 200: { - ArmDeploymentStackListResult value = default; + DeploymentStackListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -286,7 +286,7 @@ public Response ListAtScope(string scope, Cancella } } - internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, string deploymentStackName, DeploymentStackData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -298,7 +298,7 @@ internal RequestUriBuilder CreateCreateOrUpdateAtScopeRequestUri(string scope, s return uri; } - internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, ArmDeploymentStackData data) + internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, string deploymentStackName, DeploymentStackData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -327,7 +327,7 @@ internal Core.HttpMessage CreateCreateOrUpdateAtScopeRequest(string scope, strin /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAtScopeAsync(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -352,7 +352,7 @@ public async Task CreateOrUpdateAtScopeAsync(string scope, string depl /// The cancellation token to use. /// , or is null. /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, ArmDeploymentStackData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdateAtScope(string scope, string deploymentStackName, DeploymentStackData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -406,7 +406,7 @@ internal Core.HttpMessage CreateGetAtScopeRequest(string scope, string deploymen /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public async Task> GetAtScopeAsync(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -417,13 +417,13 @@ public async Task> GetAtScopeAsync(string scope { case 200: { - ArmDeploymentStackData value = default; + DeploymentStackData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ArmDeploymentStackData)null, message.Response); + return Response.FromValue((DeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -435,7 +435,7 @@ public async Task> GetAtScopeAsync(string scope /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) + public Response GetAtScope(string scope, string deploymentStackName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(scope, nameof(scope)); Argument.AssertNotNullOrEmpty(deploymentStackName, nameof(deploymentStackName)); @@ -446,13 +446,13 @@ public Response GetAtScope(string scope, string deployme { case 200: { - ArmDeploymentStackData value = default; + DeploymentStackData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDeploymentStackData.DeserializeArmDeploymentStackData(document.RootElement); + value = DeploymentStackData.DeserializeDeploymentStackData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ArmDeploymentStackData)null, message.Response); + return Response.FromValue((DeploymentStackData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -603,7 +603,7 @@ internal Core.HttpMessage CreateListAtScopeNextPageRequest(string nextLink, stri /// The resource scope. /// The cancellation token to use. /// or is null. - public async Task> ListAtScopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) + public async Task> ListAtScopeNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(scope, nameof(scope)); @@ -614,9 +614,9 @@ public async Task> ListAtScopeNextPageAsy { case 200: { - ArmDeploymentStackListResult value = default; + DeploymentStackListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -629,7 +629,7 @@ public async Task> ListAtScopeNextPageAsy /// The resource scope. /// The cancellation token to use. /// or is null. - public Response ListAtScopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) + public Response ListAtScopeNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNull(scope, nameof(scope)); @@ -640,9 +640,9 @@ public Response ListAtScopeNextPage(string nextLin { case 200: { - ArmDeploymentStackListResult value = default; + DeploymentStackListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ArmDeploymentStackListResult.DeserializeArmDeploymentStackListResult(document.RootElement); + value = DeploymentStackListResult.DeserializeDeploymentStackListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md index e1732611380f9..5d5f89ab4ff61 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md +++ b/sdk/resources/Azure.ResourceManager.Resources/src/autorest.md @@ -26,18 +26,6 @@ enable-bicep-serialization: true # show-serialized-names: true rename-mapping: - # Deployment Stack Renames - DeploymentStack: ArmDeploymentStack - DeploymentStackListResult: ArmDeploymentStackListResult - DeploymentStackProvisioingState: ArmDeploymentStackProvisioningState - DeploymentStackTemplateDefinition: ArmDeploymentStackTemplateDefinition - DeploymentStackValidateProperties: ArmDeploymentStackValidateProperties - DeploymentStackValidateResult: ArmDeploymentStackValidateResult - DeploymentStacksDebugSetting: ArmDeploymentStackDebugSetting - DeploymentStacksDeleteDetachEnum: ArmDeploymentStackDeleteDetachEnum - DeploymentStacksParametersLink: ArmDeploymentStackParametersLink - DeploymentStacksTemplateLink: ArmDeploymentStackTemplateLink - DecompileOperationSuccessResponse: DecompileOperationSuccessResult FileDefinition: DecompiledFileDefinition diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs index 8399123e859f9..1b5e771f9bea6 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/ResourcesTestBase.cs @@ -136,9 +136,9 @@ protected static ArmDeploymentProperties CreateDeploymentPropertiesUsingJsonElem Location = location }; - protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate() + protected static DeploymentStackData CreateRGDeploymentStackDataWithTemplate() { - var data = new ArmDeploymentStackData(); + var data = new DeploymentStackData(); data.Template = BinaryData.FromString(File.ReadAllText(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @@ -162,8 +162,8 @@ protected static ArmDeploymentStackData CreateRGDeploymentStackDataWithTemplate( return data; } - protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new ArmDeploymentStackData(); + protected static DeploymentStackData CreateSubDeploymentStackDataWithTemplate(AzureLocation location) { + var data = new DeploymentStackData(); data.Location = location; @@ -189,9 +189,9 @@ protected static ArmDeploymentStackData CreateSubDeploymentStackDataWithTemplate return data; } - protected static ArmDeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) + protected static DeploymentStackData CreateMGDeploymentStackDataWithTemplate(AzureLocation location) { - var data = new ArmDeploymentStackData(); + var data = new DeploymentStackData(); data.Location = location; diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs index 59304a906ec50..cb6e69387afc4 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackCollectionTests.cs @@ -31,7 +31,7 @@ public async Task CreateOrUpdateRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-CreateOrUpdate-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed ,deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -51,9 +51,9 @@ public async Task GetRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Get-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await rg.GetArmDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await rg.GetDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -73,9 +73,9 @@ public async Task ListRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-List-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - var getStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = rg.GetArmDeploymentStacks(); + var deploymentStacks = rg.GetDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -97,7 +97,7 @@ public async Task CreateOrUpdateSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-CreateOrUpdate-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -112,9 +112,9 @@ public async Task GetSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Get-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await subscription.GetArmDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await subscription.GetDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -129,9 +129,9 @@ public async Task ListSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-List-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var getStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = subscription.GetArmDeploymentStacks(); + var deploymentStacks = subscription.GetDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -154,7 +154,7 @@ public async Task CreateOrUpdateMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-CreateOrUpdate-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; Assert.AreEqual(deploymentStackName, deploymentStack.Data.Name); @@ -169,9 +169,9 @@ public async Task GetMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Get-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStackGet = (await managementGroup.GetArmDeploymentStackAsync(deploymentStackName)).Value; + var deploymentStackGet = (await managementGroup.GetDeploymentStackAsync(deploymentStackName)).Value; AssertValidDeploymentStack(deploymentStack, deploymentStackGet); @@ -186,9 +186,9 @@ public async Task ListMG() string deploymentStackName = Recording.GenerateAssetName("deployStackExMG-List-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - var getStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + var getStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; - var deploymentStacks = managementGroup.GetArmDeploymentStacks(); + var deploymentStacks = managementGroup.GetDeploymentStacks(); int count = 0; await foreach (var deploymentStack in deploymentStacks) { @@ -199,7 +199,7 @@ public async Task ListMG() await getStack.DeleteAsync(WaitUntil.Completed); } - private static void AssertValidDeploymentStack(ArmDeploymentStackResource model, ArmDeploymentStackResource getResult) + private static void AssertValidDeploymentStack(DeploymentStackResource model, DeploymentStackResource getResult) { Assert.AreEqual(model.Data.Name, getResult.Data.Name); Assert.AreEqual(model.Data.Id, getResult.Data.Id); diff --git a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs index 3a0b4e81eaf33..f287cb4a9df45 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentStackOperationsTests.cs @@ -31,7 +31,7 @@ public async Task DeleteRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Delete-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -51,7 +51,7 @@ public async Task ExportRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Export-"); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackResource deploymentStack = (await rg.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await rg.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -75,10 +75,10 @@ public async Task ValidateRG() string deploymentStackName = Recording.GenerateAssetName("deployStackRG-Validate-"); var deploymentStackId = new ResourceIdentifier(rg.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); - var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); + var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateRGDeploymentStackDataWithTemplate(); - ArmDeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; Assert.IsNotNull(deploymentStackValidateResult); await rg.DeleteAsync(WaitUntil.Completed); @@ -94,7 +94,7 @@ public async Task DeleteSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Delete-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -109,7 +109,7 @@ public async Task ExportSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Export-"); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await subscription.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await subscription.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -127,10 +127,10 @@ public async Task ValidateSub() string deploymentStackName = Recording.GenerateAssetName("deployStackSub-Validate-"); var deploymentStackId = new ResourceIdentifier(subscription.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); - var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); + var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateSubDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; Assert.NotNull(deploymentStackValidateResult); } @@ -144,7 +144,7 @@ public async Task DeleteMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Delete-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; await deploymentStack.DeleteAsync(WaitUntil.Completed); var ex = Assert.ThrowsAsync(async () => await deploymentStack.GetAsync()); @@ -159,7 +159,7 @@ public async Task ExportMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Export-"); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackResource deploymentStack = (await managementGroup.GetArmDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; + DeploymentStackResource deploymentStack = (await managementGroup.GetDeploymentStacks().CreateOrUpdateAsync(WaitUntil.Completed, deploymentStackName, deploymentStackData)).Value; var deploymentStackTemplate = (await deploymentStack.ExportTemplateAsync()).Value; Assert.IsNotNull(deploymentStackTemplate); @@ -177,10 +177,10 @@ public async Task ValidateMG() string deploymentStackName = Recording.GenerateAssetName("deployStackMG-Validate-"); var deploymentStackId = new ResourceIdentifier(managementGroup.Id + "/providers/Microsoft.Resources/deploymentStacks/" + deploymentStackName); - var deploymentStack = Client.GetArmDeploymentStackResource(deploymentStackId); + var deploymentStack = Client.GetDeploymentStackResource(deploymentStackId); var deploymentStackData = CreateMGDeploymentStackDataWithTemplate(AzureLocation.WestUS); - ArmDeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; + DeploymentStackValidateResult deploymentStackValidateResult = (await deploymentStack.ValidateStackAsync(WaitUntil.Completed, deploymentStackData)).Value; Assert.IsNotNull(deploymentStackValidateResult); } } From 4ef0a5c5115859d4d1e6b0889e4063349017e887 Mon Sep 17 00:00:00 2001 From: Dante DG Date: Fri, 28 Jun 2024 14:06:23 -0400 Subject: [PATCH 17/19] updated api --- ...esourceManager.Resources.netstandard2.0.cs | 120 +++++++++--------- ...entStackData.cs => DeploymentStackData.cs} | 0 2 files changed, 60 insertions(+), 60 deletions(-) rename sdk/resources/Azure.ResourceManager.Resources/src/Custom/{ArmDeploymentStackData.cs => DeploymentStackData.cs} (100%) diff --git a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs index f1f57414c5015..77e6f826a2c1e 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs +++ b/sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs @@ -264,26 +264,26 @@ protected ArmDeploymentScriptResource() { } public virtual Azure.Response Update(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class ArmDeploymentStackCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public partial class DeploymentStackCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected ArmDeploymentStackCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + protected DeploymentStackCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentStackName, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ArmDeploymentStackData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeploymentStackData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ArmDeploymentStackData() { } + public DeploymentStackData() { } public Azure.ResourceManager.Resources.Models.ActionOnUnmanage ActionOnUnmanage { get { throw null; } set { } } public bool? BypassStackOutOfSyncError { get { throw null; } set { } } public string CorrelationId { get { throw null; } } @@ -306,40 +306,40 @@ public ArmDeploymentStackData() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.BinaryData Template { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink TemplateLink { get { throw null; } set { } } - Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ArmDeploymentStackResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class DeploymentStackResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected ArmDeploymentStackResource() { } - public virtual Azure.ResourceManager.Resources.ArmDeploymentStackData Data { get { throw null; } } + protected DeploymentStackResource() { } + public virtual Azure.ResourceManager.Resources.DeploymentStackData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string scope, string deploymentStackName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode? unmanageActionResources = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode?), Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode? unmanageActionResourceGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode?), Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode? unmanageActionManagementGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode?), bool? bypassStackOutOfSyncError = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode? unmanageActionResources = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceMode?), Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode? unmanageActionResourceGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionResourceGroupMode?), Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode? unmanageActionManagementGroups = default(Azure.ResourceManager.Resources.Models.UnmanageActionManagementGroupMode?), bool? bypassStackOutOfSyncError = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response ExportTemplate(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExportTemplateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Resources.ArmDeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation ValidateStack(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ValidateStackAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.ArmDeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Resources.DeploymentStackData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation ValidateStack(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateStackAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Resources.DeploymentStackData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class JitRequestCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -435,16 +435,16 @@ public static partial class ResourcesExtensions public static Azure.ResourceManager.Resources.ArmDeploymentScriptCollection GetArmDeploymentScripts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetArmDeploymentScripts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetArmDeploymentScriptsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response GetArmDeploymentStack(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetArmDeploymentStackAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackResource GetArmDeploymentStackResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + public static Azure.Response GetDeploymentStack(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeploymentStack(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetDeploymentStack(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeploymentStackAsync(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeploymentStackAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDeploymentStackAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackResource GetDeploymentStackResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(this Azure.ResourceManager.ManagementGroups.ManagementGroupResource managementGroupResource) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } public static Azure.Response GetJitRequest(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetJitRequestAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetJitRequestDefinitions(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -613,7 +613,7 @@ protected MockableResourcesArmClient() { } public virtual Azure.ResourceManager.Resources.ArmApplicationResource GetArmApplicationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentResource GetArmDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentScriptResource GetArmDeploymentScriptResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Resources.ArmDeploymentStackResource GetArmDeploymentStackResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Resources.DeploymentStackResource GetDeploymentStackResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.JitRequestResource GetJitRequestResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.ScriptLogResource GetScriptLogResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Resources.TemplateSpecResource GetTemplateSpecResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -625,9 +625,9 @@ protected MockableResourcesManagementGroupResource() { } public virtual Azure.Response GetArmDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetArmDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentCollection GetArmDeployments() { throw null; } - public virtual Azure.Response GetArmDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks() { throw null; } + public virtual Azure.Response GetDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks() { throw null; } } public partial class MockableResourcesResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -644,9 +644,9 @@ protected MockableResourcesResourceGroupResource() { } public virtual Azure.Response GetArmDeploymentScript(string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetArmDeploymentScriptAsync(string scriptName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.ArmDeploymentScriptCollection GetArmDeploymentScripts() { throw null; } - public virtual Azure.Response GetArmDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks() { throw null; } + public virtual Azure.Response GetDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks() { throw null; } public virtual Azure.Response GetJitRequest(string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetJitRequestAsync(string jitRequestName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.Resources.JitRequestCollection GetJitRequests() { throw null; } @@ -666,9 +666,9 @@ protected MockableResourcesSubscriptionResource() { } public virtual Azure.ResourceManager.Resources.ArmDeploymentCollection GetArmDeployments() { throw null; } public virtual Azure.Pageable GetArmDeploymentScripts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetArmDeploymentScriptsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetArmDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetArmDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Resources.ArmDeploymentStackCollection GetArmDeploymentStacks() { throw null; } + public virtual Azure.Response GetDeploymentStack(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDeploymentStackAsync(string deploymentStackName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Resources.DeploymentStackCollection GetDeploymentStacks() { throw null; } public virtual Azure.Pageable GetJitRequestDefinitions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetJitRequestDefinitionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetTemplateSpecs(Azure.ResourceManager.Resources.Models.TemplateSpecExpandKind? expand = default(Azure.ResourceManager.Resources.Models.TemplateSpecExpandKind?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1221,7 +1221,6 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.ArmDeploymentScriptData ArmDeploymentScriptData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity identity = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, string kind = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentity ArmDeploymentScriptManagedIdentity(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType? identityType = default(Azure.ResourceManager.Resources.Models.ArmDeploymentScriptManagedIdentityType?), System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IDictionary userAssignedIdentities = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentScriptPatch ArmDeploymentScriptPatch(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) { throw null; } - public static Azure.ResourceManager.Resources.ArmDeploymentStackData ArmDeploymentStackData(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?), System.Collections.Generic.IDictionary tags = null, Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentValidateResult ArmDeploymentValidateResult(Azure.ResponseError error = null, Azure.ResourceManager.Resources.Models.ArmDeploymentPropertiesExtended properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfContent ArmDeploymentWhatIfContent(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties properties = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ArmDeploymentWhatIfProperties ArmDeploymentWhatIfProperties(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.ArmDeploymentTemplateLink templateLink = null, System.BinaryData parameters = null, Azure.ResourceManager.Resources.Models.ArmDeploymentParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ArmDeploymentMode mode = Azure.ResourceManager.Resources.Models.ArmDeploymentMode.Incremental, string debugSettingDetailLevel = null, Azure.ResourceManager.Resources.Models.ErrorDeployment errorDeployment = null, Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope? expressionEvaluationScope = default(Azure.ResourceManager.Resources.Models.ExpressionEvaluationScope?), Azure.ResourceManager.Resources.Models.WhatIfResultFormat? whatIfResultFormat = default(Azure.ResourceManager.Resources.Models.WhatIfResultFormat?)) { throw null; } @@ -1230,6 +1229,7 @@ public static partial class ArmResourcesModelFactory public static Azure.ResourceManager.Resources.Models.BasicArmDependency BasicArmDependency(string id = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompiledFileDefinition DecompiledFileDefinition(string path = null, string contents = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DecompileOperationSuccessResult DecompileOperationSuccessResult(System.Collections.Generic.IEnumerable files = null, string entryPoint = null) { throw null; } + public static Azure.ResourceManager.Resources.DeploymentStackData DeploymentStackData(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?), System.Collections.Generic.IDictionary tags = null, Azure.ResponseError error = null, System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null, System.Collections.Generic.IDictionary parameters = null, Azure.ResourceManager.Resources.Models.DeploymentStacksParametersLink parametersLink = null, Azure.ResourceManager.Resources.Models.ActionOnUnmanage actionOnUnmanage = null, string debugSettingDetailLevel = null, bool? bypassStackOutOfSyncError = default(bool?), string deploymentScope = null, string description = null, Azure.ResourceManager.Resources.Models.DenySettings denySettings = null, Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState? provisioningState = default(Azure.ResourceManager.Resources.Models.DeploymentStackProvisioningState?), string correlationId = null, System.Collections.Generic.IEnumerable detachedResources = null, System.Collections.Generic.IEnumerable deletedResources = null, System.Collections.Generic.IEnumerable failedResources = null, System.Collections.Generic.IEnumerable resources = null, string deploymentId = null, System.BinaryData outputs = null, System.TimeSpan? duration = default(System.TimeSpan?)) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackTemplateDefinition DeploymentStackTemplateDefinition(System.BinaryData template = null, Azure.ResourceManager.Resources.Models.DeploymentStacksTemplateLink templateLink = null) { throw null; } public static Azure.ResourceManager.Resources.Models.DeploymentStackValidateResult DeploymentStackValidateResult(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Resources.Models.DeploymentStackValidateProperties properties = null, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.Resources.Models.ErrorDeploymentExtended ErrorDeploymentExtended(string provisioningState = null, Azure.ResourceManager.Resources.Models.ErrorDeploymentType? deploymentType = default(Azure.ResourceManager.Resources.Models.ErrorDeploymentType?), string deploymentName = null) { throw null; } diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs similarity index 100% rename from sdk/resources/Azure.ResourceManager.Resources/src/Custom/ArmDeploymentStackData.cs rename to sdk/resources/Azure.ResourceManager.Resources/src/Custom/DeploymentStackData.cs From 23748fb5bb41323cef126ff518084a9210dd73bf Mon Sep 17 00:00:00 2001 From: Dante Date: Mon, 1 Jul 2024 13:29:48 -0400 Subject: [PATCH 18/19] Update CHANGELOG.md --- sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md index d8e028c6a315c..03705bd79ac0f 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md +++ b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md @@ -4,7 +4,7 @@ ### Features Added -- Added `ArmDeploymentStack` support. +- Added `DeploymentStack` support. ## 1.7.3 (2024-05-07) From bd0b8e2d25c53538ee34dc72a2832ba623fedb74 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 4 Jul 2024 17:53:16 +0800 Subject: [PATCH 19/19] Update changelog --- sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md index 03705bd79ac0f..b2c841f96290b 100644 --- a/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md +++ b/sdk/resources/Azure.ResourceManager.Resources/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.8.0 (2024-06-26) +## 1.8.0 (2024-07-04) ### Features Added