From c53c1e48585219e90f2518e003e6b36f8e46e25e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 15 May 2024 18:46:38 +0000 Subject: [PATCH] CodeGen from PR 28959 in Azure/azure-rest-api-specs Merge 35938ab24176e6c8abe4e4434a0287d1fed4d808 into 7dae1e5f45f91ec89d16a628e102341490ced849 --- ....ResourceManager.Network.netstandard2.0.cs | 10 ++----- .../Samples/Sample_FlowLogCollection.cs | 8 ----- .../Sample_NetworkVirtualApplianceResource.cs | 10 ++++--- .../Samples/Sample_NetworkWatcherResource.cs | 12 +------- .../src/Generated/ArmNetworkModelFactory.cs | 26 +--------------- .../Generated/FlowLogData.Serialization.cs | 17 ----------- .../src/Generated/FlowLogData.cs | 7 +---- ...tualApplianceInstanceIdsOperationSource.cs | 30 +++++++++++++++++++ .../FlowLogInformation.Serialization.cs | 17 ----------- .../Generated/Models/FlowLogInformation.cs | 7 +---- .../NetworkVirtualApplianceResource.cs | 16 +++++++--- .../NetworkVirtualAppliancesRestOperations.cs | 2 ++ .../src/autorest.md | 4 +-- 13 files changed, 59 insertions(+), 107 deletions(-) create mode 100644 sdk/network/Azure.ResourceManager.Network/src/Generated/LongRunningOperation/NetworkVirtualApplianceInstanceIdsOperationSource.cs diff --git a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs index b148dd88f939..c5c689199e27 100644 --- a/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs +++ b/sdk/network/Azure.ResourceManager.Network/api/Azure.ResourceManager.Network.netstandard2.0.cs @@ -2134,7 +2134,6 @@ public FlowLogData() { } public bool? Enabled { get { throw null; } set { } } public Azure.ETag? ETag { get { throw null; } } public Azure.ResourceManager.Network.Models.FlowLogProperties Format { get { throw null; } set { } } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.Network.Models.NetworkProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Network.Models.RetentionPolicyParameters RetentionPolicy { get { throw null; } set { } } public Azure.Core.ResourceIdentifier StorageId { get { throw null; } set { } } @@ -3931,8 +3930,8 @@ protected NetworkVirtualApplianceResource() { } public virtual Azure.ResourceManager.Network.VirtualApplianceSiteCollection GetVirtualApplianceSites() { 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 Restart(Azure.ResourceManager.Network.Models.NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task RestartAsync(Azure.ResourceManager.Network.Models.NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Restart(Azure.WaitUntil waitUntil, Azure.ResourceManager.Network.Models.NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RestartAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Network.Models.NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, 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.Network.NetworkVirtualApplianceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8902,9 +8901,7 @@ public static partial class ArmNetworkModelFactory public static Azure.ResourceManager.Network.FirewallPolicyRuleCollectionGroupData FirewallPolicyRuleCollectionGroupData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.ETag? etag, int? priority, System.Collections.Generic.IEnumerable ruleCollections, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.Network.FirewallPolicyRuleCollectionGroupData FirewallPolicyRuleCollectionGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), string size = null, int? priority = default(int?), System.Collections.Generic.IEnumerable ruleCollections = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.FirewallPolicyRuleCollectionGroupDraftData FirewallPolicyRuleCollectionGroupDraftData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string size = null, int? priority = default(int?), System.Collections.Generic.IEnumerable ruleCollections = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.Network.FlowLogData FlowLogData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType? resourceType, Azure.Core.AzureLocation? location, System.Collections.Generic.IDictionary tags, Azure.ETag? etag, Azure.Core.ResourceIdentifier targetResourceId, System.Guid? targetResourceGuid, Azure.Core.ResourceIdentifier storageId, bool? enabled, Azure.ResourceManager.Network.Models.RetentionPolicyParameters retentionPolicy, Azure.ResourceManager.Network.Models.FlowLogProperties format, Azure.ResourceManager.Network.Models.TrafficAnalyticsConfigurationProperties trafficAnalyticsConfiguration, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState) { throw null; } - public static Azure.ResourceManager.Network.FlowLogData FlowLogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.ResourceIdentifier targetResourceId = null, System.Guid? targetResourceGuid = default(System.Guid?), Azure.Core.ResourceIdentifier storageId = null, bool? enabled = default(bool?), Azure.ResourceManager.Network.Models.RetentionPolicyParameters retentionPolicy = null, Azure.ResourceManager.Network.Models.FlowLogProperties format = null, Azure.ResourceManager.Network.Models.TrafficAnalyticsConfigurationProperties trafficAnalyticsConfiguration = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } + public static Azure.ResourceManager.Network.FlowLogData FlowLogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier targetResourceId = null, System.Guid? targetResourceGuid = default(System.Guid?), Azure.Core.ResourceIdentifier storageId = null, bool? enabled = default(bool?), Azure.ResourceManager.Network.Models.RetentionPolicyParameters retentionPolicy = null, Azure.ResourceManager.Network.Models.FlowLogProperties format = null, Azure.ResourceManager.Network.Models.TrafficAnalyticsConfigurationProperties trafficAnalyticsConfiguration = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.FrontendIPConfigurationData FrontendIPConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IEnumerable zones = null, System.Collections.Generic.IEnumerable inboundNatRules = null, System.Collections.Generic.IEnumerable inboundNatPools = null, System.Collections.Generic.IEnumerable outboundRules = null, System.Collections.Generic.IEnumerable loadBalancingRules = null, string privateIPAddress = null, Azure.ResourceManager.Network.Models.NetworkIPAllocationMethod? privateIPAllocationMethod = default(Azure.ResourceManager.Network.Models.NetworkIPAllocationMethod?), Azure.ResourceManager.Network.Models.NetworkIPVersion? privateIPAddressVersion = default(Azure.ResourceManager.Network.Models.NetworkIPVersion?), Azure.ResourceManager.Network.SubnetData subnet = null, Azure.ResourceManager.Network.PublicIPAddressData publicIPAddress = null, Azure.Core.ResourceIdentifier publicIPPrefixId = null, Azure.Core.ResourceIdentifier gatewayLoadBalancerId = null, Azure.ResourceManager.Network.Models.NetworkProvisioningState? provisioningState = default(Azure.ResourceManager.Network.Models.NetworkProvisioningState?)) { throw null; } public static Azure.ResourceManager.Network.Models.GatewayRoute GatewayRoute(string localAddress = null, string network = null, string nextHop = null, string sourcePeer = null, string origin = null, string asPath = null, int? weight = default(int?)) { throw null; } public static Azure.ResourceManager.Network.Models.GatewayRouteListResult GatewayRouteListResult(System.Collections.Generic.IEnumerable value = null) { throw null; } @@ -11952,7 +11949,6 @@ public partial class FlowLogInformation : System.ClientModel.Primitives.IJsonMod public FlowLogInformation(Azure.Core.ResourceIdentifier targetResourceId, Azure.Core.ResourceIdentifier storageId, bool enabled) { } public bool Enabled { get { throw null; } set { } } public Azure.ResourceManager.Network.Models.FlowLogProperties Format { get { throw null; } set { } } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.Network.Models.RetentionPolicyParameters RetentionPolicy { get { throw null; } set { } } public Azure.Core.ResourceIdentifier StorageId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier TargetResourceId { get { throw null; } set { } } diff --git a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_FlowLogCollection.cs b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_FlowLogCollection.cs index 90982ec80c2c..7cca06f03ff6 100644 --- a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_FlowLogCollection.cs +++ b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_FlowLogCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.Models; using Azure.ResourceManager.Network.Models; namespace Azure.ResourceManager.Network.Samples @@ -44,13 +43,6 @@ public async Task CreateOrUpdate_CreateOrUpdateFlowLog() string flowLogName = "fl"; FlowLogData data = new FlowLogData() { - Identity = new ManagedServiceIdentity("UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), -}, - }, TargetResourceId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"), StorageId = new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"), Enabled = true, diff --git a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkVirtualApplianceResource.cs b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkVirtualApplianceResource.cs index 456a23690f7b..b1c448ac4c03 100644 --- a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkVirtualApplianceResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkVirtualApplianceResource.cs @@ -135,9 +135,10 @@ public async Task Restart_RestartAllNetworkVirtualApplianceVMsInVMScaleSet() NetworkVirtualApplianceResource networkVirtualAppliance = client.GetNetworkVirtualApplianceResource(networkVirtualApplianceResourceId); // invoke the operation - await networkVirtualAppliance.RestartAsync(); + ArmOperation lro = await networkVirtualAppliance.RestartAsync(WaitUntil.Completed); + NetworkVirtualApplianceInstanceIds result = lro.Value; - Console.WriteLine($"Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } // Restart Specific NetworkVirtualAppliance VMs in VM Scale Set @@ -162,9 +163,10 @@ public async Task Restart_RestartSpecificNetworkVirtualApplianceVMsInVMScaleSet( NetworkVirtualApplianceResource networkVirtualAppliance = client.GetNetworkVirtualApplianceResource(networkVirtualApplianceResourceId); // invoke the operation - await networkVirtualAppliance.RestartAsync(); + ArmOperation lro = await networkVirtualAppliance.RestartAsync(WaitUntil.Completed); + NetworkVirtualApplianceInstanceIds result = lro.Value; - Console.WriteLine($"Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } // List all Network Virtual Appliances for a given subscription diff --git a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkWatcherResource.cs b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkWatcherResource.cs index 0da7fd43604f..ac1cf167e871 100644 --- a/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkWatcherResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/samples/Generated/Samples/Sample_NetworkWatcherResource.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.Models; using Azure.ResourceManager.Network.Models; using Azure.ResourceManager.Resources; @@ -347,16 +346,7 @@ public async Task SetFlowLogConfiguration_ConfigureFlowLog() NetworkWatcherResource networkWatcher = client.GetNetworkWatcherResource(networkWatcherResourceId); // invoke the operation - FlowLogInformation flowLogInformation = new FlowLogInformation(new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), true) - { - Identity = new ManagedServiceIdentity("UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity(), -}, - }, - }; + FlowLogInformation flowLogInformation = new FlowLogInformation(new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), new ResourceIdentifier("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1"), true); ArmOperation lro = await networkWatcher.SetFlowLogConfigurationAsync(WaitUntil.Completed, flowLogInformation); FlowLogInformation result = lro.Value; diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs index 940e8f46638c..10162371d258 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/ArmNetworkModelFactory.cs @@ -1017,7 +1017,6 @@ public static NetworkPrivateEndpointConnectionData NetworkPrivateEndpointConnect /// Resource location. /// Resource tags. /// A unique read-only string that changes whenever the resource is updated. - /// FlowLog resource Managed Identity. /// ID of network security group to which flow log will be applied. /// Guid of network security group to which flow log will be applied. /// ID of the storage account which is used to store the flow log. @@ -1027,7 +1026,7 @@ public static NetworkPrivateEndpointConnectionData NetworkPrivateEndpointConnect /// Parameters that define the configuration of traffic analytics. /// The provisioning state of the flow log. /// A new instance for mocking. - public static FlowLogData FlowLogData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, AzureLocation? location = null, IDictionary tags = null, ETag? etag = null, ManagedServiceIdentity identity = null, ResourceIdentifier targetResourceId = null, Guid? targetResourceGuid = null, ResourceIdentifier storageId = null, bool? enabled = null, RetentionPolicyParameters retentionPolicy = null, FlowLogProperties format = null, TrafficAnalyticsConfigurationProperties trafficAnalyticsConfiguration = null, NetworkProvisioningState? provisioningState = null) + public static FlowLogData FlowLogData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, AzureLocation? location = null, IDictionary tags = null, ETag? etag = null, ResourceIdentifier targetResourceId = null, Guid? targetResourceGuid = null, ResourceIdentifier storageId = null, bool? enabled = null, RetentionPolicyParameters retentionPolicy = null, FlowLogProperties format = null, TrafficAnalyticsConfigurationProperties trafficAnalyticsConfiguration = null, NetworkProvisioningState? provisioningState = null) { tags ??= new Dictionary(); @@ -1039,7 +1038,6 @@ public static FlowLogData FlowLogData(ResourceIdentifier id = null, string name tags, serializedAdditionalRawData: null, etag, - identity, targetResourceId, targetResourceGuid, storageId, @@ -8083,28 +8081,6 @@ public static SubnetData SubnetData(ResourceIdentifier id, string name, Resource return SubnetData(id: id, name: name, resourceType: resourceType, etag: etag, addressPrefix: addressPrefix, addressPrefixes: addressPrefixes, networkSecurityGroup: networkSecurityGroup, routeTable: routeTable, natGatewayId: natGatewayId, serviceEndpoints: serviceEndpoints, serviceEndpointPolicies: serviceEndpointPolicies, privateEndpoints: privateEndpoints, ipConfigurations: ipConfigurations, ipConfigurationProfiles: ipConfigurationProfiles, ipAllocations: ipAllocations, resourceNavigationLinks: resourceNavigationLinks, serviceAssociationLinks: serviceAssociationLinks, delegations: delegations, purpose: purpose, provisioningState: provisioningState, privateEndpointNetworkPolicy: privateEndpointNetworkPolicy, privateLinkServiceNetworkPolicy: privateLinkServiceNetworkPolicy, applicationGatewayIPConfigurations: applicationGatewayIPConfigurations, sharingScope: default, defaultOutboundAccess: defaultOutboundAccess); } - /// Initializes a new instance of . - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A unique read-only string that changes whenever the resource is updated. - /// ID of network security group to which flow log will be applied. - /// Guid of network security group to which flow log will be applied. - /// ID of the storage account which is used to store the flow log. - /// Flag to enable/disable flow logging. - /// Parameters that define the retention policy for flow log. - /// Parameters that define the flow log format. - /// Parameters that define the configuration of traffic analytics. - /// The provisioning state of the flow log. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static FlowLogData FlowLogData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, ETag? etag, ResourceIdentifier targetResourceId, Guid? targetResourceGuid, ResourceIdentifier storageId, bool? enabled, RetentionPolicyParameters retentionPolicy, FlowLogProperties format, TrafficAnalyticsConfigurationProperties trafficAnalyticsConfiguration, NetworkProvisioningState? provisioningState) - { - return FlowLogData(id: id, name: name, resourceType: resourceType, location: location, tags: tags, etag: etag, identity: default, targetResourceId: targetResourceId, targetResourceGuid: targetResourceGuid, storageId: storageId, enabled: enabled, retentionPolicy: retentionPolicy, format: format, trafficAnalyticsConfiguration: trafficAnalyticsConfiguration, provisioningState: provisioningState); - } - /// Initializes a new instance of . /// Resource ID. /// Resource name. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.Serialization.cs index 24987b9b59c2..8eeacce31aac 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.Serialization.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.Serialization.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; using Azure.ResourceManager.Network.Models; namespace Azure.ResourceManager.Network @@ -33,11 +32,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio writer.WritePropertyName("etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -151,7 +145,6 @@ internal static FlowLogData DeserializeFlowLogData(JsonElement element, ModelRea return null; } ETag? etag = default; - ManagedServiceIdentity identity = default; ResourceIdentifier id = default; string name = default; ResourceType? type = default; @@ -178,15 +171,6 @@ internal static FlowLogData DeserializeFlowLogData(JsonElement element, ModelRea etag = new ETag(property.Value.GetString()); continue; } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } if (property.NameEquals("id"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -331,7 +315,6 @@ internal static FlowLogData DeserializeFlowLogData(JsonElement element, ModelRea tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, etag, - identity, targetResourceId, targetResourceGuid, storageId, diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.cs index 239f1a13c68d..13444feec19f 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/FlowLogData.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Models; using Azure.ResourceManager.Network.Models; namespace Azure.ResourceManager.Network @@ -32,7 +31,6 @@ public FlowLogData() /// Resource tags. /// Keeps track of any properties unknown to the library. /// A unique read-only string that changes whenever the resource is updated. - /// FlowLog resource Managed Identity. /// ID of network security group to which flow log will be applied. /// Guid of network security group to which flow log will be applied. /// ID of the storage account which is used to store the flow log. @@ -41,10 +39,9 @@ public FlowLogData() /// Parameters that define the flow log format. /// Parameters that define the configuration of traffic analytics. /// The provisioning state of the flow log. - internal FlowLogData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, IDictionary serializedAdditionalRawData, ETag? etag, ManagedServiceIdentity identity, ResourceIdentifier targetResourceId, Guid? targetResourceGuid, ResourceIdentifier storageId, bool? enabled, RetentionPolicyParameters retentionPolicy, FlowLogProperties format, TrafficAnalyticsProperties flowAnalyticsConfiguration, NetworkProvisioningState? provisioningState) : base(id, name, resourceType, location, tags, serializedAdditionalRawData) + internal FlowLogData(ResourceIdentifier id, string name, ResourceType? resourceType, AzureLocation? location, IDictionary tags, IDictionary serializedAdditionalRawData, ETag? etag, ResourceIdentifier targetResourceId, Guid? targetResourceGuid, ResourceIdentifier storageId, bool? enabled, RetentionPolicyParameters retentionPolicy, FlowLogProperties format, TrafficAnalyticsProperties flowAnalyticsConfiguration, NetworkProvisioningState? provisioningState) : base(id, name, resourceType, location, tags, serializedAdditionalRawData) { ETag = etag; - Identity = identity; TargetResourceId = targetResourceId; TargetResourceGuid = targetResourceGuid; StorageId = storageId; @@ -57,8 +54,6 @@ internal FlowLogData(ResourceIdentifier id, string name, ResourceType? resourceT /// A unique read-only string that changes whenever the resource is updated. public ETag? ETag { get; } - /// FlowLog resource Managed Identity. - public ManagedServiceIdentity Identity { get; set; } /// ID of network security group to which flow log will be applied. public ResourceIdentifier TargetResourceId { get; set; } /// Guid of network security group to which flow log will be applied. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/LongRunningOperation/NetworkVirtualApplianceInstanceIdsOperationSource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/LongRunningOperation/NetworkVirtualApplianceInstanceIdsOperationSource.cs new file mode 100644 index 000000000000..29e019444b62 --- /dev/null +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/LongRunningOperation/NetworkVirtualApplianceInstanceIdsOperationSource.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.Network.Models; + +namespace Azure.ResourceManager.Network +{ + internal class NetworkVirtualApplianceInstanceIdsOperationSource : IOperationSource + { + NetworkVirtualApplianceInstanceIds IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return NetworkVirtualApplianceInstanceIds.DeserializeNetworkVirtualApplianceInstanceIds(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return NetworkVirtualApplianceInstanceIds.DeserializeNetworkVirtualApplianceInstanceIds(document.RootElement); + } + } +} diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.Serialization.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.Serialization.cs index 7d19bec1ed79..d5fcaefa6e41 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.Serialization.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.Serialization.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Network.Models { @@ -34,11 +33,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("flowAnalyticsConfiguration"u8); writer.WriteObjectValue(FlowAnalyticsConfiguration, options); } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("storageId"u8); @@ -96,7 +90,6 @@ internal static FlowLogInformation DeserializeFlowLogInformation(JsonElement ele } ResourceIdentifier targetResourceId = default; TrafficAnalyticsProperties flowAnalyticsConfiguration = default; - ManagedServiceIdentity identity = default; ResourceIdentifier storageId = default; bool enabled = default; RetentionPolicyParameters retentionPolicy = default; @@ -119,15 +112,6 @@ internal static FlowLogInformation DeserializeFlowLogInformation(JsonElement ele flowAnalyticsConfiguration = TrafficAnalyticsProperties.DeserializeTrafficAnalyticsProperties(property.Value, options); continue; } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -177,7 +161,6 @@ internal static FlowLogInformation DeserializeFlowLogInformation(JsonElement ele return new FlowLogInformation( targetResourceId, flowAnalyticsConfiguration, - identity, storageId, enabled, retentionPolicy, diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.cs index fe9af490c712..4033faa305a8 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/Models/FlowLogInformation.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.Network.Models { @@ -65,17 +64,15 @@ public FlowLogInformation(ResourceIdentifier targetResourceId, ResourceIdentifie /// Initializes a new instance of . /// The ID of the resource to configure for flow log and traffic analytics (optional) . /// Parameters that define the configuration of traffic analytics. - /// FlowLog resource Managed Identity. /// ID of the storage account which is used to store the flow log. /// Flag to enable/disable flow logging. /// Parameters that define the retention policy for flow log. /// Parameters that define the flow log format. /// Keeps track of any properties unknown to the library. - internal FlowLogInformation(ResourceIdentifier targetResourceId, TrafficAnalyticsProperties flowAnalyticsConfiguration, ManagedServiceIdentity identity, ResourceIdentifier storageId, bool enabled, RetentionPolicyParameters retentionPolicy, FlowLogProperties format, IDictionary serializedAdditionalRawData) + internal FlowLogInformation(ResourceIdentifier targetResourceId, TrafficAnalyticsProperties flowAnalyticsConfiguration, ResourceIdentifier storageId, bool enabled, RetentionPolicyParameters retentionPolicy, FlowLogProperties format, IDictionary serializedAdditionalRawData) { TargetResourceId = targetResourceId; FlowAnalyticsConfiguration = flowAnalyticsConfiguration; - Identity = identity; StorageId = storageId; Enabled = enabled; RetentionPolicy = retentionPolicy; @@ -104,8 +101,6 @@ public TrafficAnalyticsConfigurationProperties TrafficAnalyticsConfiguration } } - /// FlowLog resource Managed Identity. - public ManagedServiceIdentity Identity { get; set; } /// ID of the storage account which is used to store the flow log. public ResourceIdentifier StorageId { get; set; } /// Flag to enable/disable flow logging. diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs index f70ac90e6de8..1fcf9ccf8c77 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/NetworkVirtualApplianceResource.cs @@ -503,16 +503,20 @@ public virtual Response Update(NetworkTagsObjec /// /// /// + /// 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. /// Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. /// The cancellation token to use. - public virtual async Task RestartAsync(NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, CancellationToken cancellationToken = default) + public virtual async Task> RestartAsync(WaitUntil waitUntil, NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, CancellationToken cancellationToken = default) { using var scope = _networkVirtualApplianceClientDiagnostics.CreateScope("NetworkVirtualApplianceResource.Restart"); scope.Start(); try { var response = await _networkVirtualApplianceRestClient.RestartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkVirtualApplianceInstanceIds, cancellationToken).ConfigureAwait(false); - return response; + var operation = new NetworkArmOperation(new NetworkVirtualApplianceInstanceIdsOperationSource(), _networkVirtualApplianceClientDiagnostics, Pipeline, _networkVirtualApplianceRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkVirtualApplianceInstanceIds).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; } catch (Exception e) { @@ -542,16 +546,20 @@ public virtual async Task RestartAsync(NetworkVirtualApplianceInstance /// /// /// + /// 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. /// Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. /// The cancellation token to use. - public virtual Response Restart(NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, CancellationToken cancellationToken = default) + public virtual ArmOperation Restart(WaitUntil waitUntil, NetworkVirtualApplianceInstanceIds networkVirtualApplianceInstanceIds = null, CancellationToken cancellationToken = default) { using var scope = _networkVirtualApplianceClientDiagnostics.CreateScope("NetworkVirtualApplianceResource.Restart"); scope.Start(); try { var response = _networkVirtualApplianceRestClient.Restart(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkVirtualApplianceInstanceIds, cancellationToken); - return response; + var operation = new NetworkArmOperation(new NetworkVirtualApplianceInstanceIdsOperationSource(), _networkVirtualApplianceClientDiagnostics, Pipeline, _networkVirtualApplianceRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkVirtualApplianceInstanceIds).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; } catch (Exception e) { diff --git a/sdk/network/Azure.ResourceManager.Network/src/Generated/RestOperations/NetworkVirtualAppliancesRestOperations.cs b/sdk/network/Azure.ResourceManager.Network/src/Generated/RestOperations/NetworkVirtualAppliancesRestOperations.cs index 74c028a39ba7..35fb8a194fb0 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/Generated/RestOperations/NetworkVirtualAppliancesRestOperations.cs +++ b/sdk/network/Azure.ResourceManager.Network/src/Generated/RestOperations/NetworkVirtualAppliancesRestOperations.cs @@ -482,6 +482,7 @@ public async Task RestartAsync(string subscriptionId, string resourceG switch (message.Response.Status) { case 200: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); @@ -507,6 +508,7 @@ public Response Restart(string subscriptionId, string resourceGroupName, string switch (message.Response.Status) { case 200: + case 202: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/network/Azure.ResourceManager.Network/src/autorest.md b/sdk/network/Azure.ResourceManager.Network/src/autorest.md index 5a75ae29097b..af0fe532f97f 100644 --- a/sdk/network/Azure.ResourceManager.Network/src/autorest.md +++ b/sdk/network/Azure.ResourceManager.Network/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Network namespace: Azure.ResourceManager.Network -require: https://github.com/Azure/azure-rest-api-specs/blob/c4e661cdf92c8f579574008d0cd11874cc303da0/specification/network/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/network/resource-manager/readme.md # tag: package-2023-11 output-folder: $(this-folder)/Generated clear-output-folder: true @@ -610,4 +610,4 @@ directive: # delete $[param]; # } -``` \ No newline at end of file +```