diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/api/Azure.ResourceManager.ContainerInstance.netstandard2.0.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/api/Azure.ResourceManager.ContainerInstance.netstandard2.0.cs index bbad1b4b8229..4e007daa402e 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/api/Azure.ResourceManager.ContainerInstance.netstandard2.0.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/api/Azure.ResourceManager.ContainerInstance.netstandard2.0.cs @@ -18,16 +18,19 @@ protected ContainerGroupCollection() { } public partial class ContainerGroupData : Azure.ResourceManager.Models.TrackedResourceData { public ContainerGroupData(Azure.Core.AzureLocation location, System.Collections.Generic.IEnumerable containers, Azure.ResourceManager.ContainerInstance.Models.ContainerInstanceOperatingSystemType osType) : base (default(Azure.Core.AzureLocation)) { } + public string ConfidentialComputeCcePolicy { get { throw null; } set { } } public System.Collections.Generic.IList Containers { get { throw null; } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupLogAnalytics DiagnosticsLogAnalytics { get { throw null; } set { } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupDnsConfiguration DnsConfig { get { throw null; } set { } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupEncryptionProperties EncryptionProperties { get { throw null; } set { } } + public System.Collections.Generic.IList Extensions { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IList ImageRegistryCredentials { get { throw null; } } public System.Collections.Generic.IList InitContainers { get { throw null; } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupInstanceView InstanceView { get { throw null; } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupIPAddress IPAddress { get { throw null; } set { } } public Azure.ResourceManager.ContainerInstance.Models.ContainerInstanceOperatingSystemType OSType { get { throw null; } set { } } + public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority? Priority { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupRestartPolicy? RestartPolicy { get { throw null; } set { } } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupSku? Sku { get { throw null; } set { } } @@ -71,6 +74,8 @@ protected ContainerGroupResource() { } } public static partial class ContainerInstanceExtensions { + public static Azure.ResourceManager.ArmOperation DeleteSubnetServiceAssociationLink(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.WaitUntil waitUntil, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task DeleteSubnetServiceAssociationLinkAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.WaitUntil waitUntil, string virtualNetworkName, string subnetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetCachedImagesWithLocation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetCachedImagesWithLocationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetCapabilitiesWithLocation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -87,27 +92,6 @@ public static partial class ContainerInstanceExtensions } namespace Azure.ResourceManager.ContainerInstance.Models { - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public AutoGeneratedDomainNameLabelScope(string value) { throw null; } - public static Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } - public static Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } - public static Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } - public static Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } - public static Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope Unsecure { get { throw null; } } - public bool Equals(Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope 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.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } - public static implicit operator Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } - public override string ToString() { throw null; } - } public partial class CachedImages { internal CachedImages() { } @@ -200,13 +184,14 @@ public ContainerGroupDnsConfiguration(System.Collections.Generic.IEnumerable ports, Azure.ResourceManager.ContainerInstance.Models.ContainerGroupIPAddressType addressType) { } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupIPAddressType AddressType { get { throw null; } set { } } + public Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } public string DnsNameLabel { get { throw null; } set { } } - public Azure.ResourceManager.ContainerInstance.Models.AutoGeneratedDomainNameLabelScope? DnsNameLabelReusePolicy { get { throw null; } set { } } public string Fqdn { get { throw null; } } public System.Net.IPAddress IP { get { throw null; } set { } } public System.Collections.Generic.IList Ports { get { throw null; } } @@ -304,6 +289,24 @@ public ContainerGroupPort(int port) { } public Azure.ResourceManager.ContainerInstance.Models.ContainerGroupNetworkProtocol? Protocol { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerGroupPriority : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerGroupPriority(string value) { throw null; } + public static Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority Regular { get { throw null; } } + public static Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority Spot { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority 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.ContainerInstance.Models.ContainerGroupPriority left, Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority left, Azure.ResourceManager.ContainerInstance.Models.ContainerGroupPriority right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerGroupRestartPolicy : System.IEquatable { private readonly object _dummy; @@ -328,6 +331,7 @@ public ContainerGroupPort(int port) { } private readonly object _dummy; private readonly int _dummyPrimitive; public ContainerGroupSku(string value) { throw null; } + public static Azure.ResourceManager.ContainerInstance.Models.ContainerGroupSku Confidential { get { throw null; } } public static Azure.ResourceManager.ContainerInstance.Models.ContainerGroupSku Dedicated { get { throw null; } } public static Azure.ResourceManager.ContainerInstance.Models.ContainerGroupSku Standard { get { throw null; } } public bool Equals(Azure.ResourceManager.ContainerInstance.Models.ContainerGroupSku other) { throw null; } @@ -429,6 +433,7 @@ public partial class ContainerInstanceUsage { internal ContainerInstanceUsage() { } public int? CurrentValue { get { throw null; } } + public string Id { get { throw null; } } public int? Limit { get { throw null; } } public Azure.ResourceManager.ContainerInstance.Models.ContainerInstanceUsageName Name { get { throw null; } } public string Unit { get { throw null; } } @@ -539,6 +544,36 @@ public ContainerVolumeMount(string name, string mountPath) { } public string MountPath { get { throw null; } set { } } public string Name { get { throw null; } set { } } } + public partial class DeploymentExtensionSpec + { + public DeploymentExtensionSpec(string name) { } + public string ExtensionType { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData ProtectedSettings { get { throw null; } set { } } + public System.BinaryData Settings { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DnsNameLabelReusePolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DnsNameLabelReusePolicy(string value) { throw null; } + public static Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy NoReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy TenantReuse { get { throw null; } } + public static Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy Unsecure { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy 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.ContainerInstance.Models.DnsNameLabelReusePolicy left, Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy left, Azure.ResourceManager.ContainerInstance.Models.DnsNameLabelReusePolicy right) { throw null; } + public override string ToString() { throw null; } + } public partial class InitContainerDefinitionContent { public InitContainerDefinitionContent(string name) { } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/ContainerGroupData.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/ContainerGroupData.cs index 063b9225db09..983b95c27628 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/ContainerGroupData.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/ContainerGroupData.cs @@ -26,13 +26,14 @@ public ContainerGroupData(AzureLocation location, IEnumerable(); Containers = containers.ToList(); ImageRegistryCredentials = new ChangeTrackingList(); OSType = osType; Volumes = new ChangeTrackingList(); SubnetIds = new ChangeTrackingList(); InitContainers = new ChangeTrackingList(); - Zones = new ChangeTrackingList(); + Extensions = new ChangeTrackingList(); } /// Initializes a new instance of ContainerGroupData. @@ -42,6 +43,7 @@ public ContainerGroupData(AzureLocation location, IEnumerable The systemData. /// The tags. /// The location. + /// The zones for the container group. /// The identity of the container group, if configured. /// The provisioning state of the container group. This only appears in the response. /// The containers within the container group. @@ -63,9 +65,12 @@ public ContainerGroupData(AzureLocation location, IEnumerable The SKU for a container group. /// The encryption properties for a container group. /// The init containers for a container group. - /// The zones for the container group. - internal ContainerGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string provisioningState, IList containers, IList imageRegistryCredentials, ContainerGroupRestartPolicy? restartPolicy, ContainerGroupIPAddress ipAddress, ContainerInstanceOperatingSystemType osType, IList volumes, ContainerGroupInstanceView instanceView, ContainerGroupDiagnostics diagnostics, IList subnetIds, ContainerGroupDnsConfiguration dnsConfig, ContainerGroupSku? sku, ContainerGroupEncryptionProperties encryptionProperties, IList initContainers, IList zones) : base(id, name, resourceType, systemData, tags, location) + /// extensions used by virtual kubelet. + /// The properties for confidential container group. + /// The priority of the container group. + internal ContainerGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList zones, ManagedServiceIdentity identity, string provisioningState, IList containers, IList imageRegistryCredentials, ContainerGroupRestartPolicy? restartPolicy, ContainerGroupIPAddress ipAddress, ContainerInstanceOperatingSystemType osType, IList volumes, ContainerGroupInstanceView instanceView, ContainerGroupDiagnostics diagnostics, IList subnetIds, ContainerGroupDnsConfiguration dnsConfig, ContainerGroupSku? sku, ContainerGroupEncryptionProperties encryptionProperties, IList initContainers, IList extensions, ConfidentialComputeProperties confidentialComputeProperties, ContainerGroupPriority? priority) : base(id, name, resourceType, systemData, tags, location) { + Zones = zones; Identity = identity; ProvisioningState = provisioningState; Containers = containers; @@ -81,9 +86,13 @@ internal ContainerGroupData(ResourceIdentifier id, string name, ResourceType res Sku = sku; EncryptionProperties = encryptionProperties; InitContainers = initContainers; - Zones = zones; + Extensions = extensions; + ConfidentialComputeProperties = confidentialComputeProperties; + Priority = priority; } + /// The zones for the container group. + public IList Zones { get; } /// The identity of the container group, if configured. public ManagedServiceIdentity Identity { get; set; } /// The provisioning state of the container group. This only appears in the response. @@ -132,7 +141,23 @@ public ContainerGroupLogAnalytics DiagnosticsLogAnalytics public ContainerGroupEncryptionProperties EncryptionProperties { get; set; } /// The init containers for a container group. public IList InitContainers { get; } - /// The zones for the container group. - public IList Zones { get; } + /// extensions used by virtual kubelet. + public IList Extensions { get; } + /// The properties for confidential container group. + internal ConfidentialComputeProperties ConfidentialComputeProperties { get; set; } + /// The base64 encoded confidential compute enforcement policy. + public string ConfidentialComputeCcePolicy + { + get => ConfidentialComputeProperties is null ? default : ConfidentialComputeProperties.CcePolicy; + set + { + if (ConfidentialComputeProperties is null) + ConfidentialComputeProperties = new ConfidentialComputeProperties(); + ConfidentialComputeProperties.CcePolicy = value; + } + } + + /// The priority of the container group. + public ContainerGroupPriority? Priority { get; set; } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs index 62892f36192e..cde1581db7c8 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ContainerInstanceExtensions.cs @@ -187,6 +187,46 @@ public static Response GetContainerGroup(this ResourceGr return resourceGroupResource.GetContainerGroups().Get(containerGroupName, cancellationToken); } + /// + /// Delete container group virtual network association links. The operation does not delete other resources provided by the user. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default + /// Operation Id: SubnetServiceAssociationLink_Delete + /// + /// The instance the method will execute against. + /// 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. + /// The name of the virtual network. + /// The name of the subnet. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task DeleteSubnetServiceAssociationLinkAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); + + return await GetExtensionClient(resourceGroupResource).DeleteSubnetServiceAssociationLinkAsync(waitUntil, virtualNetworkName, subnetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete container group virtual network association links. The operation does not delete other resources provided by the user. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default + /// Operation Id: SubnetServiceAssociationLink_Delete + /// + /// The instance the method will execute against. + /// 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. + /// The name of the virtual network. + /// The name of the subnet. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public static ArmOperation DeleteSubnetServiceAssociationLink(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); + + return GetExtensionClient(resourceGroupResource).DeleteSubnetServiceAssociationLink(waitUntil, virtualNetworkName, subnetName, cancellationToken); + } + #region ContainerGroupResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index f152a06ce4fc..847460b5a60b 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -5,7 +5,12 @@ #nullable disable +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.Core.Pipeline; using Azure.ResourceManager; namespace Azure.ResourceManager.ContainerInstance @@ -13,6 +18,9 @@ namespace Azure.ResourceManager.ContainerInstance /// A class to add extension methods to ResourceGroupResource. internal partial class ResourceGroupResourceExtensionClient : ArmResource { + private ClientDiagnostics _subnetServiceAssociationLinkClientDiagnostics; + private SubnetServiceAssociationLinkRestOperations _subnetServiceAssociationLinkRestClient; + /// Initializes a new instance of the class for mocking. protected ResourceGroupResourceExtensionClient() { @@ -25,6 +33,9 @@ internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifi { } + private ClientDiagnostics SubnetServiceAssociationLinkClientDiagnostics => _subnetServiceAssociationLinkClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerInstance", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private SubnetServiceAssociationLinkRestOperations SubnetServiceAssociationLinkRestClient => _subnetServiceAssociationLinkRestClient ??= new SubnetServiceAssociationLinkRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); @@ -37,5 +48,61 @@ public virtual ContainerGroupCollection GetContainerGroups() { return GetCachedClient(Client => new ContainerGroupCollection(Client, Id)); } + + /// + /// Delete container group virtual network association links. The operation does not delete other resources provided by the user. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default + /// Operation Id: SubnetServiceAssociationLink_Delete + /// + /// 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. + /// The name of the virtual network. + /// The name of the subnet. + /// The cancellation token to use. + public virtual async Task DeleteSubnetServiceAssociationLinkAsync(WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) + { + using var scope = SubnetServiceAssociationLinkClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteSubnetServiceAssociationLink"); + scope.Start(); + try + { + var response = await SubnetServiceAssociationLinkRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, virtualNetworkName, subnetName, cancellationToken).ConfigureAwait(false); + var operation = new ContainerInstanceArmOperation(SubnetServiceAssociationLinkClientDiagnostics, Pipeline, SubnetServiceAssociationLinkRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, virtualNetworkName, subnetName).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete container group virtual network association links. The operation does not delete other resources provided by the user. + /// Request Path: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default + /// Operation Id: SubnetServiceAssociationLink_Delete + /// + /// 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. + /// The name of the virtual network. + /// The name of the subnet. + /// The cancellation token to use. + public virtual ArmOperation DeleteSubnetServiceAssociationLink(WaitUntil waitUntil, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) + { + using var scope = SubnetServiceAssociationLinkClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.DeleteSubnetServiceAssociationLink"); + scope.Start(); + try + { + var response = SubnetServiceAssociationLinkRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, virtualNetworkName, subnetName, cancellationToken); + var operation = new ContainerInstanceArmOperation(SubnetServiceAssociationLinkClientDiagnostics, Pipeline, SubnetServiceAssociationLinkRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, virtualNetworkName, subnetName).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs deleted file mode 100644 index 6ecbafb92396..000000000000 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerInstance.Models -{ - /// The value representing the security enum. - public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutoGeneratedDomainNameLabelScope(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UnsecureValue = "Unsecure"; - private const string TenantReuseValue = "TenantReuse"; - private const string SubscriptionReuseValue = "SubscriptionReuse"; - private const string ResourceGroupReuseValue = "ResourceGroupReuse"; - private const string NoReuseValue = "Noreuse"; - - /// Unsecure. - public static AutoGeneratedDomainNameLabelScope Unsecure { get; } = new AutoGeneratedDomainNameLabelScope(UnsecureValue); - /// TenantReuse. - public static AutoGeneratedDomainNameLabelScope TenantReuse { get; } = new AutoGeneratedDomainNameLabelScope(TenantReuseValue); - /// SubscriptionReuse. - public static AutoGeneratedDomainNameLabelScope SubscriptionReuse { get; } = new AutoGeneratedDomainNameLabelScope(SubscriptionReuseValue); - /// ResourceGroupReuse. - public static AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get; } = new AutoGeneratedDomainNameLabelScope(ResourceGroupReuseValue); - /// Noreuse. - public static AutoGeneratedDomainNameLabelScope NoReuse { get; } = new AutoGeneratedDomainNameLabelScope(NoReuseValue); - /// Determines if two values are the same. - public static bool operator ==(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutoGeneratedDomainNameLabelScope(string value) => new AutoGeneratedDomainNameLabelScope(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutoGeneratedDomainNameLabelScope other && Equals(other); - /// - public bool Equals(AutoGeneratedDomainNameLabelScope 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/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ConfidentialComputeProperties.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ConfidentialComputeProperties.Serialization.cs new file mode 100644 index 000000000000..e3a4338c25c0 --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ConfidentialComputeProperties.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerInstance.Models +{ + internal partial class ConfidentialComputeProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(CcePolicy)) + { + writer.WritePropertyName("ccePolicy"); + writer.WriteStringValue(CcePolicy); + } + writer.WriteEndObject(); + } + + internal static ConfidentialComputeProperties DeserializeConfidentialComputeProperties(JsonElement element) + { + Optional ccePolicy = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ccePolicy")) + { + ccePolicy = property.Value.GetString(); + continue; + } + } + return new ConfidentialComputeProperties(ccePolicy.Value); + } + } +} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ConfidentialComputeProperties.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ConfidentialComputeProperties.cs new file mode 100644 index 000000000000..cd4f97d4685d --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ConfidentialComputeProperties.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.ContainerInstance.Models +{ + /// The properties for confidential container group. + internal partial class ConfidentialComputeProperties + { + /// Initializes a new instance of ConfidentialComputeProperties. + public ConfidentialComputeProperties() + { + } + + /// Initializes a new instance of ConfidentialComputeProperties. + /// The base64 encoded confidential compute enforcement policy. + internal ConfidentialComputeProperties(string ccePolicy) + { + CcePolicy = ccePolicy; + } + + /// The base64 encoded confidential compute enforcement policy. + public string CcePolicy { get; set; } + } +} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupData.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupData.Serialization.cs index dde3e910040b..2fc5a738e9f3 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupData.Serialization.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupData.Serialization.cs @@ -18,11 +18,6 @@ public partial class ContainerGroupData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"); - JsonSerializer.Serialize(writer, Identity); - } if (Optional.IsCollectionDefined(Zones)) { writer.WritePropertyName("zones"); @@ -33,6 +28,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + JsonSerializer.Serialize(writer, Identity); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -127,14 +127,34 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ConfidentialComputeProperties)) + { + writer.WritePropertyName("confidentialComputeProperties"); + writer.WriteObjectValue(ConfidentialComputeProperties); + } + if (Optional.IsDefined(Priority)) + { + writer.WritePropertyName("priority"); + writer.WriteStringValue(Priority.Value.ToString()); + } writer.WriteEndObject(); writer.WriteEndObject(); } internal static ContainerGroupData DeserializeContainerGroupData(JsonElement element) { - Optional identity = default; Optional> zones = default; + Optional identity = default; Optional> tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -155,31 +175,34 @@ internal static ContainerGroupData DeserializeContainerGroupData(JsonElement ele Optional sku = default; Optional encryptionProperties = default; Optional> initContainers = default; + Optional> extensions = default; + Optional confidentialComputeProperties = default; + Optional priority = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity")) + if (property.NameEquals("zones")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - identity = JsonSerializer.Deserialize(property.Value.ToString()); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; continue; } - if (property.NameEquals("zones")) + if (property.NameEquals("identity")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - zones = array; + identity = JsonSerializer.Deserialize(property.Value.ToString()); continue; } if (property.NameEquals("tags")) @@ -386,11 +409,46 @@ internal static ContainerGroupData DeserializeContainerGroupData(JsonElement ele initContainers = array; continue; } + if (property0.NameEquals("extensions")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DeploymentExtensionSpec.DeserializeDeploymentExtensionSpec(item)); + } + extensions = array; + continue; + } + if (property0.NameEquals("confidentialComputeProperties")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + confidentialComputeProperties = ConfidentialComputeProperties.DeserializeConfidentialComputeProperties(property0.Value); + continue; + } + if (property0.NameEquals("priority")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + priority = new ContainerGroupPriority(property0.Value.GetString()); + continue; + } } continue; } } - return new ContainerGroupData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, identity, provisioningState.Value, containers, Optional.ToList(imageRegistryCredentials), Optional.ToNullable(restartPolicy), ipAddress.Value, osType, Optional.ToList(volumes), instanceView.Value, diagnostics.Value, Optional.ToList(subnetIds), dnsConfig.Value, Optional.ToNullable(sku), encryptionProperties.Value, Optional.ToList(initContainers), Optional.ToList(zones)); + return new ContainerGroupData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToList(zones), identity, provisioningState.Value, containers, Optional.ToList(imageRegistryCredentials), Optional.ToNullable(restartPolicy), ipAddress.Value, osType, Optional.ToList(volumes), instanceView.Value, diagnostics.Value, Optional.ToList(subnetIds), dnsConfig.Value, Optional.ToNullable(sku), encryptionProperties.Value, Optional.ToList(initContainers), Optional.ToList(extensions), confidentialComputeProperties.Value, Optional.ToNullable(priority)); } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.Serialization.cs index 603e112348f5..503006413cec 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.Serialization.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.Serialization.cs @@ -22,6 +22,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(KeyName); writer.WritePropertyName("keyVersion"); writer.WriteStringValue(KeyVersion); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteStringValue(Identity); + } writer.WriteEndObject(); } @@ -30,6 +35,7 @@ internal static ContainerGroupEncryptionProperties DeserializeContainerGroupEncr Uri vaultBaseUrl = default; string keyName = default; string keyVersion = default; + Optional identity = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("vaultBaseUrl")) @@ -47,8 +53,13 @@ internal static ContainerGroupEncryptionProperties DeserializeContainerGroupEncr keyVersion = property.Value.GetString(); continue; } + if (property.NameEquals("identity")) + { + identity = property.Value.GetString(); + continue; + } } - return new ContainerGroupEncryptionProperties(vaultBaseUrl, keyName, keyVersion); + return new ContainerGroupEncryptionProperties(vaultBaseUrl, keyName, keyVersion, identity.Value); } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.cs index bb5a6dd40e90..a3750abc92ef 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupEncryptionProperties.cs @@ -29,11 +29,26 @@ public ContainerGroupEncryptionProperties(Uri vaultBaseUri, string keyName, stri KeyVersion = keyVersion; } + /// Initializes a new instance of ContainerGroupEncryptionProperties. + /// The keyvault base url. + /// The encryption key name. + /// The encryption key version. + /// The keyvault managed identity. + internal ContainerGroupEncryptionProperties(Uri vaultBaseUri, string keyName, string keyVersion, string identity) + { + VaultBaseUri = vaultBaseUri; + KeyName = keyName; + KeyVersion = keyVersion; + Identity = identity; + } + /// The keyvault base url. public Uri VaultBaseUri { get; set; } /// The encryption key name. public string KeyName { get; set; } /// The encryption key version. public string KeyVersion { get; set; } + /// The keyvault managed identity. + public string Identity { get; set; } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.Serialization.cs index e61caa650526..e2c218249c5c 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.Serialization.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.Serialization.cs @@ -36,10 +36,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("dnsNameLabel"); writer.WriteStringValue(DnsNameLabel); } - if (Optional.IsDefined(DnsNameLabelReusePolicy)) + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) { - writer.WritePropertyName("dnsNameLabelReusePolicy"); - writer.WriteStringValue(DnsNameLabelReusePolicy.Value.ToString()); + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); } writer.WriteEndObject(); } @@ -50,7 +50,7 @@ internal static ContainerGroupIPAddress DeserializeContainerGroupIPAddress(JsonE ContainerGroupIPAddressType type = default; Optional ip = default; Optional dnsNameLabel = default; - Optional dnsNameLabelReusePolicy = default; + Optional autoGeneratedDomainNameLabelScope = default; Optional fqdn = default; foreach (var property in element.EnumerateObject()) { @@ -84,14 +84,14 @@ internal static ContainerGroupIPAddress DeserializeContainerGroupIPAddress(JsonE dnsNameLabel = property.Value.GetString(); continue; } - if (property.NameEquals("dnsNameLabelReusePolicy")) + if (property.NameEquals("autoGeneratedDomainNameLabelScope")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - dnsNameLabelReusePolicy = new AutoGeneratedDomainNameLabelScope(property.Value.GetString()); + autoGeneratedDomainNameLabelScope = new DnsNameLabelReusePolicy(property.Value.GetString()); continue; } if (property.NameEquals("fqdn")) @@ -100,7 +100,7 @@ internal static ContainerGroupIPAddress DeserializeContainerGroupIPAddress(JsonE continue; } } - return new ContainerGroupIPAddress(ports, type, ip.Value, dnsNameLabel.Value, Optional.ToNullable(dnsNameLabelReusePolicy), fqdn.Value); + return new ContainerGroupIPAddress(ports, type, ip.Value, dnsNameLabel.Value, Optional.ToNullable(autoGeneratedDomainNameLabelScope), fqdn.Value); } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.cs index 426d9ea75f3b..a3ae55b3f489 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupIPAddress.cs @@ -33,15 +33,15 @@ public ContainerGroupIPAddress(IEnumerable ports, ContainerG /// Specifies if the IP is exposed to the public internet or private VNET. /// The IP exposed to the public internet. /// The Dns name label for the IP. - /// The value representing the security enum. + /// The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, subscription, or tenant. /// The FQDN for the IP. - internal ContainerGroupIPAddress(IList ports, ContainerGroupIPAddressType addressType, IPAddress ip, string dnsNameLabel, AutoGeneratedDomainNameLabelScope? dnsNameLabelReusePolicy, string fqdn) + internal ContainerGroupIPAddress(IList ports, ContainerGroupIPAddressType addressType, IPAddress ip, string dnsNameLabel, DnsNameLabelReusePolicy? autoGeneratedDomainNameLabelScope, string fqdn) { Ports = ports; AddressType = addressType; IP = ip; DnsNameLabel = dnsNameLabel; - DnsNameLabelReusePolicy = dnsNameLabelReusePolicy; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; Fqdn = fqdn; } @@ -53,8 +53,8 @@ internal ContainerGroupIPAddress(IList ports, ContainerGroup public IPAddress IP { get; set; } /// The Dns name label for the IP. public string DnsNameLabel { get; set; } - /// The value representing the security enum. - public AutoGeneratedDomainNameLabelScope? DnsNameLabelReusePolicy { get; set; } + /// The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, subscription, or tenant. + public DnsNameLabelReusePolicy? AutoGeneratedDomainNameLabelScope { get; set; } /// The FQDN for the IP. public string Fqdn { get; } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.Serialization.cs index 378c0f2f53fc..d30cca5c14aa 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.Serialization.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.Serialization.cs @@ -18,8 +18,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStartObject(); writer.WritePropertyName("server"); writer.WriteStringValue(Server); - writer.WritePropertyName("username"); - writer.WriteStringValue(Username); + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"); + writer.WriteStringValue(Username); + } if (Optional.IsDefined(Password)) { writer.WritePropertyName("password"); @@ -41,7 +44,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ContainerGroupImageRegistryCredential DeserializeContainerGroupImageRegistryCredential(JsonElement element) { string server = default; - string username = default; + Optional username = default; Optional password = default; Optional identity = default; Optional identityUrl = default; @@ -78,7 +81,7 @@ internal static ContainerGroupImageRegistryCredential DeserializeContainerGroupI continue; } } - return new ContainerGroupImageRegistryCredential(server, username, password.Value, identity.Value, identityUrl.Value); + return new ContainerGroupImageRegistryCredential(server, username.Value, password.Value, identity.Value, identityUrl.Value); } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.cs index 5815538fa76b..fd7d478c0128 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupImageRegistryCredential.cs @@ -15,15 +15,12 @@ public partial class ContainerGroupImageRegistryCredential { /// Initializes a new instance of ContainerGroupImageRegistryCredential. /// The Docker image registry server without a protocol such as "http" and "https". - /// The username for the private registry. - /// or is null. - public ContainerGroupImageRegistryCredential(string server, string username) + /// is null. + public ContainerGroupImageRegistryCredential(string server) { Argument.AssertNotNull(server, nameof(server)); - Argument.AssertNotNull(username, nameof(username)); Server = server; - Username = username; } /// Initializes a new instance of ContainerGroupImageRegistryCredential. diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupPriority.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupPriority.cs new file mode 100644 index 000000000000..9a99cdf3377a --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupPriority.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.ContainerInstance.Models +{ + /// The priority of the container group. + public readonly partial struct ContainerGroupPriority : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerGroupPriority(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegularValue = "Regular"; + private const string SpotValue = "Spot"; + + /// Regular. + public static ContainerGroupPriority Regular { get; } = new ContainerGroupPriority(RegularValue); + /// Spot. + public static ContainerGroupPriority Spot { get; } = new ContainerGroupPriority(SpotValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerGroupPriority left, ContainerGroupPriority right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerGroupPriority left, ContainerGroupPriority right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContainerGroupPriority(string value) => new ContainerGroupPriority(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerGroupPriority other && Equals(other); + /// + public bool Equals(ContainerGroupPriority 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/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupSku.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupSku.cs index b8ecb2b69402..630d9200a05e 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupSku.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerGroupSku.cs @@ -24,11 +24,14 @@ public ContainerGroupSku(string value) private const string StandardValue = "Standard"; private const string DedicatedValue = "Dedicated"; + private const string ConfidentialValue = "Confidential"; /// Standard. public static ContainerGroupSku Standard { get; } = new ContainerGroupSku(StandardValue); /// Dedicated. public static ContainerGroupSku Dedicated { get; } = new ContainerGroupSku(DedicatedValue); + /// Confidential. + public static ContainerGroupSku Confidential { get; } = new ContainerGroupSku(ConfidentialValue); /// Determines if two values are the same. public static bool operator ==(ContainerGroupSku left, ContainerGroupSku right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.Serialization.cs index aff30dba9a5c..20b611b6e4e9 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.Serialization.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.Serialization.cs @@ -14,12 +14,18 @@ public partial class ContainerInstanceUsage { internal static ContainerInstanceUsage DeserializeContainerInstanceUsage(JsonElement element) { + Optional id = default; Optional unit = default; Optional currentValue = default; Optional limit = default; Optional name = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } if (property.NameEquals("unit")) { unit = property.Value.GetString(); @@ -56,7 +62,7 @@ internal static ContainerInstanceUsage DeserializeContainerInstanceUsage(JsonEle continue; } } - return new ContainerInstanceUsage(unit.Value, Optional.ToNullable(currentValue), Optional.ToNullable(limit), name.Value); + return new ContainerInstanceUsage(id.Value, unit.Value, Optional.ToNullable(currentValue), Optional.ToNullable(limit), name.Value); } } } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.cs index afcc8341e330..7c071c284840 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/ContainerInstanceUsage.cs @@ -16,18 +16,22 @@ internal ContainerInstanceUsage() } /// Initializes a new instance of ContainerInstanceUsage. + /// Id of the usage result. /// Unit of the usage result. /// The current usage of the resource. /// The maximum permitted usage of the resource. /// The name object of the resource. - internal ContainerInstanceUsage(string unit, int? currentValue, int? limit, ContainerInstanceUsageName name) + internal ContainerInstanceUsage(string id, string unit, int? currentValue, int? limit, ContainerInstanceUsageName name) { + Id = id; Unit = unit; CurrentValue = currentValue; Limit = limit; Name = name; } + /// Id of the usage result. + public string Id { get; } /// Unit of the usage result. public string Unit { get; } /// The current usage of the resource. diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DeploymentExtensionSpec.Serialization.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DeploymentExtensionSpec.Serialization.cs new file mode 100644 index 000000000000..056e9e9e76ac --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DeploymentExtensionSpec.Serialization.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerInstance.Models +{ + public partial class DeploymentExtensionSpec : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"); + writer.WriteStringValue(Name); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(ExtensionType)) + { + writer.WritePropertyName("extensionType"); + writer.WriteStringValue(ExtensionType); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Settings)) + { + writer.WritePropertyName("settings"); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Settings); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(Settings.ToString()).RootElement); +#endif + } + if (Optional.IsDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"); +#if NET6_0_OR_GREATER + writer.WriteRawValue(ProtectedSettings); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(ProtectedSettings.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static DeploymentExtensionSpec DeserializeDeploymentExtensionSpec(JsonElement element) + { + string name = default; + Optional extensionType = default; + Optional version = default; + Optional settings = default; + Optional protectedSettings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("extensionType")) + { + extensionType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("version")) + { + version = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("settings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + settings = BinaryData.FromString(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("protectedSettings")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + protectedSettings = BinaryData.FromString(property0.Value.GetRawText()); + continue; + } + } + continue; + } + } + return new DeploymentExtensionSpec(name, extensionType.Value, version.Value, settings.Value, protectedSettings.Value); + } + } +} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DeploymentExtensionSpec.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DeploymentExtensionSpec.cs new file mode 100644 index 000000000000..21f5dba6ed1e --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DeploymentExtensionSpec.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerInstance.Models +{ + /// Extension sidecars to be added to the deployment. + public partial class DeploymentExtensionSpec + { + /// Initializes a new instance of DeploymentExtensionSpec. + /// Name of the extension. + /// is null. + public DeploymentExtensionSpec(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of DeploymentExtensionSpec. + /// Name of the extension. + /// Type of extension to be added. + /// Version of the extension being used. + /// Settings for the extension. + /// Protected settings for the extension. + internal DeploymentExtensionSpec(string name, string extensionType, string version, BinaryData settings, BinaryData protectedSettings) + { + Name = name; + ExtensionType = extensionType; + Version = version; + Settings = settings; + ProtectedSettings = protectedSettings; + } + + /// Name of the extension. + public string Name { get; set; } + /// Type of extension to be added. + public string ExtensionType { get; set; } + /// Version of the extension being used. + public string Version { get; set; } + /// + /// Settings for the extension. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public BinaryData Settings { get; set; } + /// + /// Protected settings for the extension. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public BinaryData ProtectedSettings { get; set; } + } +} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DnsNameLabelReusePolicy.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DnsNameLabelReusePolicy.cs new file mode 100644 index 000000000000..0155798242e2 --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/Models/DnsNameLabelReusePolicy.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerInstance.Models +{ + /// The value representing the security enum. The 'Unsecure' value is the default value if not selected and means the object's domain name label is not secured against subdomain takeover. The 'TenantReuse' value is the default value if selected and means the object's domain name label can be reused within the same tenant. The 'SubscriptionReuse' value means the object's domain name label can be reused within the same subscription. The 'ResourceGroupReuse' value means the object's domain name label can be reused within the same resource group. The 'NoReuse' value means the object's domain name label cannot be reused within the same resource group, subscription, or tenant. + public readonly partial struct DnsNameLabelReusePolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DnsNameLabelReusePolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnsecureValue = "Unsecure"; + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + private const string NoReuseValue = "Noreuse"; + + /// Unsecure. + public static DnsNameLabelReusePolicy Unsecure { get; } = new DnsNameLabelReusePolicy(UnsecureValue); + /// TenantReuse. + public static DnsNameLabelReusePolicy TenantReuse { get; } = new DnsNameLabelReusePolicy(TenantReuseValue); + /// SubscriptionReuse. + public static DnsNameLabelReusePolicy SubscriptionReuse { get; } = new DnsNameLabelReusePolicy(SubscriptionReuseValue); + /// ResourceGroupReuse. + public static DnsNameLabelReusePolicy ResourceGroupReuse { get; } = new DnsNameLabelReusePolicy(ResourceGroupReuseValue); + /// Noreuse. + public static DnsNameLabelReusePolicy NoReuse { get; } = new DnsNameLabelReusePolicy(NoReuseValue); + /// Determines if two values are the same. + public static bool operator ==(DnsNameLabelReusePolicy left, DnsNameLabelReusePolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DnsNameLabelReusePolicy left, DnsNameLabelReusePolicy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DnsNameLabelReusePolicy(string value) => new DnsNameLabelReusePolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DnsNameLabelReusePolicy other && Equals(other); + /// + public bool Equals(DnsNameLabelReusePolicy 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/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainerGroupsRestOperations.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainerGroupsRestOperations.cs index 9a7f51f40ee1..ca587291ef5a 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainerGroupsRestOperations.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainerGroupsRestOperations.cs @@ -34,7 +34,7 @@ public ContainerGroupsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-10-01"; + _apiVersion = apiVersion ?? "2022-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -673,6 +673,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro switch (message.Response.Status) { case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -697,6 +698,7 @@ public Response Start(string subscriptionId, string resourceGroupName, string co switch (message.Response.Status) { case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainersRestOperations.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainersRestOperations.cs index bab0de7a5bce..85227605f7ef 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainersRestOperations.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/ContainersRestOperations.cs @@ -33,7 +33,7 @@ public ContainersRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-10-01"; + _apiVersion = apiVersion ?? "2022-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/LocationRestOperations.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/LocationRestOperations.cs index 5973bf432713..82380587b1ad 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/LocationRestOperations.cs +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/LocationRestOperations.cs @@ -33,7 +33,7 @@ public LocationRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-10-01"; + _apiVersion = apiVersion ?? "2022-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/SubnetServiceAssociationLinkRestOperations.cs b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/SubnetServiceAssociationLinkRestOperations.cs new file mode 100644 index 000000000000..8eb7419f4b2d --- /dev/null +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/Generated/RestOperations/SubnetServiceAssociationLinkRestOperations.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerInstance +{ + internal partial class SubnetServiceAssociationLinkRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SubnetServiceAssociationLinkRestOperations. + /// 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 SubnetServiceAssociationLinkRestOperations(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 ?? "2022-10-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string virtualNetworkName, string subnetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourcegroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Network/virtualNetworks/", false); + uri.AppendPath(virtualNetworkName, true); + uri.AppendPath("/subnets/", false); + uri.AppendPath(subnetName, true); + uri.AppendPath("/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete container group virtual network association links. The operation does not delete other resources provided by the user. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The name of the resource group. + /// The name of the virtual network. + /// The name of the subnet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, virtualNetworkName, subnetName); + 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); + } + } + + /// Delete container group virtual network association links. The operation does not delete other resources provided by the user. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The name of the resource group. + /// The name of the virtual network. + /// The name of the subnet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string virtualNetworkName, string subnetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(virtualNetworkName, nameof(virtualNetworkName)); + Argument.AssertNotNullOrEmpty(subnetName, nameof(subnetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, virtualNetworkName, subnetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/autorest.md b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/autorest.md index 2987d6d542e1..8b9e3bd0fb8a 100644 --- a/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/autorest.md +++ b/sdk/containerinstance/Azure.ResourceManager.ContainerInstance/src/autorest.md @@ -6,7 +6,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: ContainerInstance namespace: Azure.ResourceManager.ContainerInstance -require: https://github.com/Azure/azure-rest-api-specs/blob/4716fb039c67e1bee1d5448af9ce57e4942832fe/specification/containerinstance/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerinstance/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true