diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroup.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroup.cs
new file mode 100644
index 000000000000..253815697fd2
--- /dev/null
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroup.cs
@@ -0,0 +1,245 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Core;
+
+namespace Azure.ResourceManager.Sql
+{
+ /// A Class representing a DistributedAvailabilityGroup along with the instance operations that can be performed on it.
+ public partial class DistributedAvailabilityGroup : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string managedInstanceName, string distributedAvailabilityGroupName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _distributedAvailabilityGroupClientDiagnostics;
+ private readonly DistributedAvailabilityGroupsRestOperations _distributedAvailabilityGroupRestClient;
+ private readonly DistributedAvailabilityGroupData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DistributedAvailabilityGroup()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal DistributedAvailabilityGroup(ArmClient client, DistributedAvailabilityGroupData data) : this(client, data.Id)
+ {
+ HasData = true;
+ _data = data;
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal DistributedAvailabilityGroup(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _distributedAvailabilityGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ResourceType.Namespace, DiagnosticOptions);
+ TryGetApiVersion(ResourceType, out string distributedAvailabilityGroupApiVersion);
+ _distributedAvailabilityGroupRestClient = new DistributedAvailabilityGroupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, distributedAvailabilityGroupApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.Sql/managedInstances/distributedAvailabilityGroups";
+
+ /// Gets whether or not the current instance has data.
+ public virtual bool HasData { get; }
+
+ /// Gets the data representing this Feature.
+ /// Throws if there is no data loaded in the current instance.
+ public virtual DistributedAvailabilityGroupData Data
+ {
+ get
+ {
+ if (!HasData)
+ throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
+ return _data;
+ }
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
+ }
+
+ ///
+ /// Gets a distributed availability group info.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroup.Get");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DistributedAvailabilityGroup(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets a distributed availability group info.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroup.Get");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DistributedAvailabilityGroup(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Drops a distributed availability group between Sql On-Prem and Sql Managed Instance.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Delete
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroup.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SqlArmOperation(_distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Drops a distributed availability group between Sql On-Prem and Sql Managed Instance.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Delete
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroup.Delete");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new SqlArmOperation(_distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Updates a distributed availability group replication mode.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Update
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The distributed availability group info.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, DistributedAvailabilityGroupData parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroup.Update");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, parameters, cancellationToken).ConfigureAwait(false);
+ var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, parameters).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Updates a distributed availability group replication mode.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Update
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The distributed availability group info.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, DistributedAvailabilityGroupData parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroup.Update");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, parameters, cancellationToken);
+ var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, parameters).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs
new file mode 100644
index 000000000000..aac9b4a08c07
--- /dev/null
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupCollection.cs
@@ -0,0 +1,388 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Core;
+
+namespace Azure.ResourceManager.Sql
+{
+ /// A class representing collection of DistributedAvailabilityGroup and their operations over its parent.
+ public partial class DistributedAvailabilityGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _distributedAvailabilityGroupClientDiagnostics;
+ private readonly DistributedAvailabilityGroupsRestOperations _distributedAvailabilityGroupRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DistributedAvailabilityGroupCollection()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the parent resource that is the target of operations.
+ internal DistributedAvailabilityGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _distributedAvailabilityGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", DistributedAvailabilityGroup.ResourceType.Namespace, DiagnosticOptions);
+ TryGetApiVersion(DistributedAvailabilityGroup.ResourceType, out string distributedAvailabilityGroupApiVersion);
+ _distributedAvailabilityGroupRestClient = new DistributedAvailabilityGroupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, distributedAvailabilityGroupApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ManagedInstance.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ManagedInstance.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Creates a distributed availability group between Sql On-Prem and Sql Managed Instance.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_CreateOrUpdate
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The distributed availability group name.
+ /// The distributed availability group info.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string distributedAvailabilityGroupName, DistributedAvailabilityGroupData parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, parameters, cancellationToken).ConfigureAwait(false);
+ var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, parameters).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Creates a distributed availability group between Sql On-Prem and Sql Managed Instance.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_CreateOrUpdate
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The distributed availability group name.
+ /// The distributed availability group info.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string distributedAvailabilityGroupName, DistributedAvailabilityGroupData parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, parameters, cancellationToken);
+ var operation = new SqlArmOperation(new DistributedAvailabilityGroupOperationSource(Client), _distributedAvailabilityGroupClientDiagnostics, Pipeline, _distributedAvailabilityGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, parameters).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets a distributed availability group info.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The distributed availability group name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DistributedAvailabilityGroup(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets a distributed availability group info.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The distributed availability group name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DistributedAvailabilityGroup(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets a list of a distributed availability groups in instance.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups
+ /// Operation Id: DistributedAvailabilityGroups_ListByInstance
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.ListByInstanceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new DistributedAvailabilityGroup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.ListByInstanceNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new DistributedAvailabilityGroup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ ///
+ /// Gets a list of a distributed availability groups in instance.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups
+ /// Operation Id: DistributedAvailabilityGroups_ListByInstance
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.ListByInstance(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new DistributedAvailabilityGroup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.ListByInstanceNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new DistributedAvailabilityGroup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The distributed availability group name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await GetIfExistsAsync(distributedAvailabilityGroupName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The distributed availability group name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = GetIfExists(distributedAvailabilityGroupName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The distributed availability group name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _distributedAvailabilityGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return Response.FromValue(null, response.GetRawResponse());
+ return Response.FromValue(new DistributedAvailabilityGroup(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}
+ /// Operation Id: DistributedAvailabilityGroups_Get
+ ///
+ /// The distributed availability group name.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response GetIfExists(string distributedAvailabilityGroupName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(distributedAvailabilityGroupName, nameof(distributedAvailabilityGroupName));
+
+ using var scope = _distributedAvailabilityGroupClientDiagnostics.CreateScope("DistributedAvailabilityGroupCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _distributedAvailabilityGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, distributedAvailabilityGroupName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return Response.FromValue(null, response.GetRawResponse());
+ return Response.FromValue(new DistributedAvailabilityGroup(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetAll().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetAll().GetEnumerator();
+ }
+
+ IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken)
+ {
+ return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
+ }
+ }
+}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs
new file mode 100644
index 000000000000..06d9c4fc49fe
--- /dev/null
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/DistributedAvailabilityGroupData.cs
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Sql.Models;
+
+namespace Azure.ResourceManager.Sql
+{
+ /// A class representing the DistributedAvailabilityGroup data model.
+ public partial class DistributedAvailabilityGroupData : ResourceData
+ {
+ /// Initializes a new instance of DistributedAvailabilityGroupData.
+ public DistributedAvailabilityGroupData()
+ {
+ }
+
+ /// Initializes a new instance of DistributedAvailabilityGroupData.
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The name of the target database.
+ /// The source endpoint.
+ /// The primary availability group name.
+ /// The secondary availability group name.
+ /// The replication mode of a distributed availability group. Parameter will be ignored during link creation.
+ /// The distributed availability group id.
+ /// The source replica id.
+ /// The target replica id.
+ /// The link state.
+ /// The last hardened lsn.
+ internal DistributedAvailabilityGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string targetDatabase, string sourceEndpoint, string primaryAvailabilityGroupName, string secondaryAvailabilityGroupName, ReplicationMode? replicationMode, Guid? distributedAvailabilityGroupId, Guid? sourceReplicaId, Guid? targetReplicaId, string linkState, string lastHardenedLsn) : base(id, name, resourceType, systemData)
+ {
+ TargetDatabase = targetDatabase;
+ SourceEndpoint = sourceEndpoint;
+ PrimaryAvailabilityGroupName = primaryAvailabilityGroupName;
+ SecondaryAvailabilityGroupName = secondaryAvailabilityGroupName;
+ ReplicationMode = replicationMode;
+ DistributedAvailabilityGroupId = distributedAvailabilityGroupId;
+ SourceReplicaId = sourceReplicaId;
+ TargetReplicaId = targetReplicaId;
+ LinkState = linkState;
+ LastHardenedLsn = lastHardenedLsn;
+ }
+
+ /// The name of the target database.
+ public string TargetDatabase { get; set; }
+ /// The source endpoint.
+ public string SourceEndpoint { get; set; }
+ /// The primary availability group name.
+ public string PrimaryAvailabilityGroupName { get; set; }
+ /// The secondary availability group name.
+ public string SecondaryAvailabilityGroupName { get; set; }
+ /// The replication mode of a distributed availability group. Parameter will be ignored during link creation.
+ public ReplicationMode? ReplicationMode { get; set; }
+ /// The distributed availability group id.
+ public Guid? DistributedAvailabilityGroupId { get; }
+ /// The source replica id.
+ public Guid? SourceReplicaId { get; }
+ /// The target replica id.
+ public Guid? TargetReplicaId { get; }
+ /// The link state.
+ public string LinkState { get; }
+ /// The last hardened lsn.
+ public string LastHardenedLsn { get; }
+ }
+}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolCollection.cs
index 3ba2de505e71..27ec7e2ea31b 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolCollection.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolCollection.cs
@@ -182,7 +182,7 @@ public virtual Response Get(string elasticPoolName, CancellationTok
/// The number of elements in the collection to skip.
/// The cancellation token to use.
/// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetAllAsync(int? skip = null, CancellationToken cancellationToken = default)
+ public virtual AsyncPageable GetAllAsync(long? skip = null, CancellationToken cancellationToken = default)
{
async Task> FirstPageFunc(int? pageSizeHint)
{
@@ -225,7 +225,7 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
/// The number of elements in the collection to skip.
/// The cancellation token to use.
/// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetAll(int? skip = null, CancellationToken cancellationToken = default)
+ public virtual Pageable GetAll(long? skip = null, CancellationToken cancellationToken = default)
{
Page FirstPageFunc(int? pageSizeHint)
{
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolData.cs
index 62cc992bf9ce..00b440a12358 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolData.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ElasticPoolData.cs
@@ -47,7 +47,8 @@ public ElasticPoolData(AzureLocation location) : base(location)
/// Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
/// The license type to apply for this elastic pool.
/// Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur.
- internal ElasticPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SqlSku sku, string kind, ElasticPoolState? state, DateTimeOffset? creationDate, long? maxSizeBytes, ElasticPoolPerDatabaseSettings perDatabaseSettings, bool? zoneRedundant, ElasticPoolLicenseType? licenseType, string maintenanceConfigurationId) : base(id, name, resourceType, systemData, tags, location)
+ /// The number of secondary replicas associated with the elastic pool that are used to provide high availability.
+ internal ElasticPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SqlSku sku, string kind, ElasticPoolState? state, DateTimeOffset? creationDate, long? maxSizeBytes, ElasticPoolPerDatabaseSettings perDatabaseSettings, bool? zoneRedundant, ElasticPoolLicenseType? licenseType, string maintenanceConfigurationId, int? highAvailabilityReplicaCount) : base(id, name, resourceType, systemData, tags, location)
{
Sku = sku;
Kind = kind;
@@ -58,6 +59,7 @@ internal ElasticPoolData(ResourceIdentifier id, string name, ResourceType resour
ZoneRedundant = zoneRedundant;
LicenseType = licenseType;
MaintenanceConfigurationId = maintenanceConfigurationId;
+ HighAvailabilityReplicaCount = highAvailabilityReplicaCount;
}
///
@@ -87,5 +89,7 @@ internal ElasticPoolData(ResourceIdentifier id, string name, ResourceType resour
public ElasticPoolLicenseType? LicenseType { get; set; }
/// Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur.
public string MaintenanceConfigurationId { get; set; }
+ /// The number of secondary replicas associated with the elastic pool that are used to provide high availability.
+ public int? HighAvailabilityReplicaCount { get; set; }
}
}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ArmClientExtensions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ArmClientExtensions.cs
index 5fff58a9c747..2cf98824b5e5 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ArmClientExtensions.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ArmClientExtensions.cs
@@ -749,70 +749,6 @@ public static JobVersion GetJobVersion(this ArmClient client, ResourceIdentifier
}
#endregion
- #region SubscriptionLongTermRetentionBackup
- /// Gets an object representing a SubscriptionLongTermRetentionBackup along with the instance operations that can be performed on it but with no data.
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// Returns a object.
- public static SubscriptionLongTermRetentionBackup GetSubscriptionLongTermRetentionBackup(this ArmClient client, ResourceIdentifier id)
- {
- return client.GetClient(() =>
- {
- SubscriptionLongTermRetentionBackup.ValidateResourceId(id);
- return new SubscriptionLongTermRetentionBackup(client, id);
- }
- );
- }
- #endregion
-
- #region ResourceGroupLongTermRetentionBackup
- /// Gets an object representing a ResourceGroupLongTermRetentionBackup along with the instance operations that can be performed on it but with no data.
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// Returns a object.
- public static ResourceGroupLongTermRetentionBackup GetResourceGroupLongTermRetentionBackup(this ArmClient client, ResourceIdentifier id)
- {
- return client.GetClient(() =>
- {
- ResourceGroupLongTermRetentionBackup.ValidateResourceId(id);
- return new ResourceGroupLongTermRetentionBackup(client, id);
- }
- );
- }
- #endregion
-
- #region SubscriptionLongTermRetentionManagedInstanceBackup
- /// Gets an object representing a SubscriptionLongTermRetentionManagedInstanceBackup along with the instance operations that can be performed on it but with no data.
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// Returns a object.
- public static SubscriptionLongTermRetentionManagedInstanceBackup GetSubscriptionLongTermRetentionManagedInstanceBackup(this ArmClient client, ResourceIdentifier id)
- {
- return client.GetClient(() =>
- {
- SubscriptionLongTermRetentionManagedInstanceBackup.ValidateResourceId(id);
- return new SubscriptionLongTermRetentionManagedInstanceBackup(client, id);
- }
- );
- }
- #endregion
-
- #region ResourceGroupLongTermRetentionManagedInstanceBackup
- /// Gets an object representing a ResourceGroupLongTermRetentionManagedInstanceBackup along with the instance operations that can be performed on it but with no data.
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// Returns a object.
- public static ResourceGroupLongTermRetentionManagedInstanceBackup GetResourceGroupLongTermRetentionManagedInstanceBackup(this ArmClient client, ResourceIdentifier id)
- {
- return client.GetClient(() =>
- {
- ResourceGroupLongTermRetentionManagedInstanceBackup.ValidateResourceId(id);
- return new ResourceGroupLongTermRetentionManagedInstanceBackup(client, id);
- }
- );
- }
- #endregion
-
#region LongTermRetentionPolicy
/// Gets an object representing a LongTermRetentionPolicy along with the instance operations that can be performed on it but with no data.
/// The instance the method will execute against.
@@ -1117,22 +1053,6 @@ public static ManagedInstancePrivateLink GetManagedInstancePrivateLink(this ArmC
}
#endregion
- #region ManagedInstance
- /// Gets an object representing a ManagedInstance along with the instance operations that can be performed on it but with no data.
- /// The instance the method will execute against.
- /// The resource ID of the resource to get.
- /// Returns a object.
- public static ManagedInstance GetManagedInstance(this ArmClient client, ResourceIdentifier id)
- {
- return client.GetClient(() =>
- {
- ManagedInstance.ValidateResourceId(id);
- return new ManagedInstance(client, id);
- }
- );
- }
- #endregion
-
#region ManagedInstanceVulnerabilityAssessment
/// Gets an object representing a ManagedInstanceVulnerabilityAssessment along with the instance operations that can be performed on it but with no data.
/// The instance the method will execute against.
@@ -1597,6 +1517,102 @@ public static OutboundFirewallRule GetOutboundFirewallRule(this ArmClient client
}
#endregion
+ #region SqlServer
+ /// Gets an object representing a SqlServer along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static SqlServer GetSqlServer(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ SqlServer.ValidateResourceId(id);
+ return new SqlServer(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region SubscriptionLongTermRetentionBackup
+ /// Gets an object representing a SubscriptionLongTermRetentionBackup along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static SubscriptionLongTermRetentionBackup GetSubscriptionLongTermRetentionBackup(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ SubscriptionLongTermRetentionBackup.ValidateResourceId(id);
+ return new SubscriptionLongTermRetentionBackup(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region ResourceGroupLongTermRetentionBackup
+ /// Gets an object representing a ResourceGroupLongTermRetentionBackup along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static ResourceGroupLongTermRetentionBackup GetResourceGroupLongTermRetentionBackup(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ ResourceGroupLongTermRetentionBackup.ValidateResourceId(id);
+ return new ResourceGroupLongTermRetentionBackup(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region SubscriptionLongTermRetentionManagedInstanceBackup
+ /// Gets an object representing a SubscriptionLongTermRetentionManagedInstanceBackup along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static SubscriptionLongTermRetentionManagedInstanceBackup GetSubscriptionLongTermRetentionManagedInstanceBackup(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ SubscriptionLongTermRetentionManagedInstanceBackup.ValidateResourceId(id);
+ return new SubscriptionLongTermRetentionManagedInstanceBackup(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region ResourceGroupLongTermRetentionManagedInstanceBackup
+ /// Gets an object representing a ResourceGroupLongTermRetentionManagedInstanceBackup along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static ResourceGroupLongTermRetentionManagedInstanceBackup GetResourceGroupLongTermRetentionManagedInstanceBackup(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ ResourceGroupLongTermRetentionManagedInstanceBackup.ValidateResourceId(id);
+ return new ResourceGroupLongTermRetentionManagedInstanceBackup(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region ManagedInstance
+ /// Gets an object representing a ManagedInstance along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static ManagedInstance GetManagedInstance(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ ManagedInstance.ValidateResourceId(id);
+ return new ManagedInstance(client, id);
+ }
+ );
+ }
+ #endregion
+
#region RestorableDroppedDatabase
/// Gets an object representing a RestorableDroppedDatabase along with the instance operations that can be performed on it but with no data.
/// The instance the method will execute against.
@@ -1629,33 +1645,65 @@ public static RestorableDroppedManagedDatabase GetRestorableDroppedManagedDataba
}
#endregion
- #region SqlServer
- /// Gets an object representing a SqlServer along with the instance operations that can be performed on it but with no data.
+ #region ServerConnectionPolicy
+ /// Gets an object representing a ServerConnectionPolicy along with the instance operations that can be performed on it but with no data.
/// The instance the method will execute against.
/// The resource ID of the resource to get.
- /// Returns a object.
- public static SqlServer GetSqlServer(this ArmClient client, ResourceIdentifier id)
+ /// Returns a object.
+ public static ServerConnectionPolicy GetServerConnectionPolicy(this ArmClient client, ResourceIdentifier id)
{
return client.GetClient(() =>
{
- SqlServer.ValidateResourceId(id);
- return new SqlServer(client, id);
+ ServerConnectionPolicy.ValidateResourceId(id);
+ return new ServerConnectionPolicy(client, id);
}
);
}
#endregion
- #region ServerConnectionPolicy
- /// Gets an object representing a ServerConnectionPolicy along with the instance operations that can be performed on it but with no data.
+ #region DistributedAvailabilityGroup
+ /// Gets an object representing a DistributedAvailabilityGroup along with the instance operations that can be performed on it but with no data.
/// The instance the method will execute against.
/// The resource ID of the resource to get.
- /// Returns a object.
- public static ServerConnectionPolicy GetServerConnectionPolicy(this ArmClient client, ResourceIdentifier id)
+ /// Returns a object.
+ public static DistributedAvailabilityGroup GetDistributedAvailabilityGroup(this ArmClient client, ResourceIdentifier id)
{
return client.GetClient(() =>
{
- ServerConnectionPolicy.ValidateResourceId(id);
- return new ServerConnectionPolicy(client, id);
+ DistributedAvailabilityGroup.ValidateResourceId(id);
+ return new DistributedAvailabilityGroup(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region ServerTrustCertificate
+ /// Gets an object representing a ServerTrustCertificate along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static ServerTrustCertificate GetServerTrustCertificate(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ ServerTrustCertificate.ValidateResourceId(id);
+ return new ServerTrustCertificate(client, id);
+ }
+ );
+ }
+ #endregion
+
+ #region IPv6FirewallRule
+ /// Gets an object representing a IPv6FirewallRule along with the instance operations that can be performed on it but with no data.
+ /// The instance the method will execute against.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public static IPv6FirewallRule GetIPv6FirewallRule(this ArmClient client, ResourceIdentifier id)
+ {
+ return client.GetClient(() =>
+ {
+ IPv6FirewallRule.ValidateResourceId(id);
+ return new IPv6FirewallRule(client, id);
}
);
}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensionClient.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensionClient.cs
index f8dd68347936..c93a71d3aad1 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensionClient.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensionClient.cs
@@ -64,6 +64,28 @@ public virtual InstancePoolCollection GetInstancePools()
return new InstancePoolCollection(Client, Id);
}
+ /// Gets a collection of ServerTrustGroups in the ServerTrustGroup.
+ /// The name of the region where the resource is located.
+ /// An object representing collection of ServerTrustGroups and their operations over a ServerTrustGroup.
+ public virtual ServerTrustGroupCollection GetServerTrustGroups(string locationName)
+ {
+ return new ServerTrustGroupCollection(Client, Id, locationName);
+ }
+
+ /// Gets a collection of VirtualClusters in the VirtualCluster.
+ /// An object representing collection of VirtualClusters and their operations over a VirtualCluster.
+ public virtual VirtualClusterCollection GetVirtualClusters()
+ {
+ return new VirtualClusterCollection(Client, Id);
+ }
+
+ /// Gets a collection of SqlServers in the SqlServer.
+ /// An object representing collection of SqlServers and their operations over a SqlServer.
+ public virtual SqlServerCollection GetSqlServers()
+ {
+ return new SqlServerCollection(Client, Id);
+ }
+
/// Gets a collection of ResourceGroupLongTermRetentionBackups in the ResourceGroupLongTermRetentionBackup.
/// The location of the database.
/// The name of the server.
@@ -91,28 +113,6 @@ public virtual ManagedInstanceCollection GetManagedInstances()
return new ManagedInstanceCollection(Client, Id);
}
- /// Gets a collection of ServerTrustGroups in the ServerTrustGroup.
- /// The name of the region where the resource is located.
- /// An object representing collection of ServerTrustGroups and their operations over a ServerTrustGroup.
- public virtual ServerTrustGroupCollection GetServerTrustGroups(string locationName)
- {
- return new ServerTrustGroupCollection(Client, Id, locationName);
- }
-
- /// Gets a collection of VirtualClusters in the VirtualCluster.
- /// An object representing collection of VirtualClusters and their operations over a VirtualCluster.
- public virtual VirtualClusterCollection GetVirtualClusters()
- {
- return new VirtualClusterCollection(Client, Id);
- }
-
- /// Gets a collection of SqlServers in the SqlServer.
- /// An object representing collection of SqlServers and their operations over a SqlServer.
- public virtual SqlServerCollection GetSqlServers()
- {
- return new SqlServerCollection(Client, Id);
- }
-
///
/// Lists the long term retention backups for a given location.
/// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensions.cs
index e22aae4f8d6e..6da3cf3649d9 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensions.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensions.cs
@@ -110,6 +110,129 @@ public static Response GetInstancePool(this ResourceGroup resource
return resourceGroup.GetInstancePools().Get(instancePoolName, cancellationToken);
}
+ /// Gets a collection of ServerTrustGroups in the ServerTrustGroup.
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// An object representing collection of ServerTrustGroups and their operations over a ServerTrustGroup.
+ public static ServerTrustGroupCollection GetServerTrustGroups(this ResourceGroup resourceGroup, string locationName)
+ {
+ Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
+
+ return GetExtensionClient(resourceGroup).GetServerTrustGroups(locationName);
+ }
+
+ ///
+ /// Gets a server trust group.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}
+ /// Operation Id: ServerTrustGroups_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// The name of the server trust group.
+ /// The cancellation token to use.
+ /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public static async Task> GetServerTrustGroupAsync(this ResourceGroup resourceGroup, string locationName, string serverTrustGroupName, CancellationToken cancellationToken = default)
+ {
+ return await resourceGroup.GetServerTrustGroups(locationName).GetAsync(serverTrustGroupName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets a server trust group.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}
+ /// Operation Id: ServerTrustGroups_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// The name of the server trust group.
+ /// The cancellation token to use.
+ /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public static Response GetServerTrustGroup(this ResourceGroup resourceGroup, string locationName, string serverTrustGroupName, CancellationToken cancellationToken = default)
+ {
+ return resourceGroup.GetServerTrustGroups(locationName).Get(serverTrustGroupName, cancellationToken);
+ }
+
+ /// Gets a collection of VirtualClusters in the VirtualCluster.
+ /// The instance the method will execute against.
+ /// An object representing collection of VirtualClusters and their operations over a VirtualCluster.
+ public static VirtualClusterCollection GetVirtualClusters(this ResourceGroup resourceGroup)
+ {
+ return GetExtensionClient(resourceGroup).GetVirtualClusters();
+ }
+
+ ///
+ /// Gets a virtual cluster.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}
+ /// Operation Id: VirtualClusters_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the virtual cluster.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public static async Task> GetVirtualClusterAsync(this ResourceGroup resourceGroup, string virtualClusterName, CancellationToken cancellationToken = default)
+ {
+ return await resourceGroup.GetVirtualClusters().GetAsync(virtualClusterName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets a virtual cluster.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}
+ /// Operation Id: VirtualClusters_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the virtual cluster.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public static Response GetVirtualCluster(this ResourceGroup resourceGroup, string virtualClusterName, CancellationToken cancellationToken = default)
+ {
+ return resourceGroup.GetVirtualClusters().Get(virtualClusterName, cancellationToken);
+ }
+
+ /// Gets a collection of SqlServers in the SqlServer.
+ /// The instance the method will execute against.
+ /// An object representing collection of SqlServers and their operations over a SqlServer.
+ public static SqlServerCollection GetSqlServers(this ResourceGroup resourceGroup)
+ {
+ return GetExtensionClient(resourceGroup).GetSqlServers();
+ }
+
+ ///
+ /// Gets a server.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}
+ /// Operation Id: Servers_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the server.
+ /// The child resources to include in the response.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public static async Task> GetSqlServerAsync(this ResourceGroup resourceGroup, string serverName, string expand = null, CancellationToken cancellationToken = default)
+ {
+ return await resourceGroup.GetSqlServers().GetAsync(serverName, expand, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets a server.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}
+ /// Operation Id: Servers_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the server.
+ /// The child resources to include in the response.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public static Response GetSqlServer(this ResourceGroup resourceGroup, string serverName, string expand = null, CancellationToken cancellationToken = default)
+ {
+ return resourceGroup.GetSqlServers().Get(serverName, expand, cancellationToken);
+ }
+
/// Gets a collection of ResourceGroupLongTermRetentionBackups in the ResourceGroupLongTermRetentionBackup.
/// The instance the method will execute against.
/// The location of the database.
@@ -256,129 +379,6 @@ public static Response GetManagedInstance(this ResourceGroup re
return resourceGroup.GetManagedInstances().Get(managedInstanceName, expand, cancellationToken);
}
- /// Gets a collection of ServerTrustGroups in the ServerTrustGroup.
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// An object representing collection of ServerTrustGroups and their operations over a ServerTrustGroup.
- public static ServerTrustGroupCollection GetServerTrustGroups(this ResourceGroup resourceGroup, string locationName)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(resourceGroup).GetServerTrustGroups(locationName);
- }
-
- ///
- /// Gets a server trust group.
- /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}
- /// Operation Id: ServerTrustGroups_Get
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// The name of the server trust group.
- /// The cancellation token to use.
- /// or is an empty string, and was expected to be non-empty.
- /// or is null.
- public static async Task> GetServerTrustGroupAsync(this ResourceGroup resourceGroup, string locationName, string serverTrustGroupName, CancellationToken cancellationToken = default)
- {
- return await resourceGroup.GetServerTrustGroups(locationName).GetAsync(serverTrustGroupName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets a server trust group.
- /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}
- /// Operation Id: ServerTrustGroups_Get
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// The name of the server trust group.
- /// The cancellation token to use.
- /// or is an empty string, and was expected to be non-empty.
- /// or is null.
- public static Response GetServerTrustGroup(this ResourceGroup resourceGroup, string locationName, string serverTrustGroupName, CancellationToken cancellationToken = default)
- {
- return resourceGroup.GetServerTrustGroups(locationName).Get(serverTrustGroupName, cancellationToken);
- }
-
- /// Gets a collection of VirtualClusters in the VirtualCluster.
- /// The instance the method will execute against.
- /// An object representing collection of VirtualClusters and their operations over a VirtualCluster.
- public static VirtualClusterCollection GetVirtualClusters(this ResourceGroup resourceGroup)
- {
- return GetExtensionClient(resourceGroup).GetVirtualClusters();
- }
-
- ///
- /// Gets a virtual cluster.
- /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}
- /// Operation Id: VirtualClusters_Get
- ///
- /// The instance the method will execute against.
- /// The name of the virtual cluster.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public static async Task> GetVirtualClusterAsync(this ResourceGroup resourceGroup, string virtualClusterName, CancellationToken cancellationToken = default)
- {
- return await resourceGroup.GetVirtualClusters().GetAsync(virtualClusterName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets a virtual cluster.
- /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}
- /// Operation Id: VirtualClusters_Get
- ///
- /// The instance the method will execute against.
- /// The name of the virtual cluster.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public static Response GetVirtualCluster(this ResourceGroup resourceGroup, string virtualClusterName, CancellationToken cancellationToken = default)
- {
- return resourceGroup.GetVirtualClusters().Get(virtualClusterName, cancellationToken);
- }
-
- /// Gets a collection of SqlServers in the SqlServer.
- /// The instance the method will execute against.
- /// An object representing collection of SqlServers and their operations over a SqlServer.
- public static SqlServerCollection GetSqlServers(this ResourceGroup resourceGroup)
- {
- return GetExtensionClient(resourceGroup).GetSqlServers();
- }
-
- ///
- /// Gets a server.
- /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}
- /// Operation Id: Servers_Get
- ///
- /// The instance the method will execute against.
- /// The name of the server.
- /// The child resources to include in the response.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public static async Task> GetSqlServerAsync(this ResourceGroup resourceGroup, string serverName, string expand = null, CancellationToken cancellationToken = default)
- {
- return await resourceGroup.GetSqlServers().GetAsync(serverName, expand, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets a server.
- /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}
- /// Operation Id: Servers_Get
- ///
- /// The instance the method will execute against.
- /// The name of the server.
- /// The child resources to include in the response.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public static Response GetSqlServer(this ResourceGroup resourceGroup, string serverName, string expand = null, CancellationToken cancellationToken = default)
- {
- return resourceGroup.GetSqlServers().Get(serverName, expand, cancellationToken);
- }
-
///
/// Lists the long term retention backups for a given location.
/// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensionClient.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensionClient.cs
index 089c251c9161..395e672f1b18 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensionClient.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensionClient.cs
@@ -28,20 +28,18 @@ internal partial class SubscriptionExtensionClient : ArmResource
private InstancePoolsRestOperations _instancePoolRestClient;
private ClientDiagnostics _capabilitiesClientDiagnostics;
private CapabilitiesRestOperations _capabilitiesRestClient;
- private ClientDiagnostics _longTermRetentionBackupsClientDiagnostics;
- private LongTermRetentionBackupsRestOperations _longTermRetentionBackupsRestClient;
- private ClientDiagnostics _longTermRetentionManagedInstanceBackupsClientDiagnostics;
- private LongTermRetentionManagedInstanceBackupsRestOperations _longTermRetentionManagedInstanceBackupsRestClient;
- private ClientDiagnostics _managedInstanceClientDiagnostics;
- private ManagedInstancesRestOperations _managedInstanceRestClient;
- private ClientDiagnostics _operationsHealthClientDiagnostics;
- private OperationsHealthRestOperations _operationsHealthRestClient;
private ClientDiagnostics _syncGroupClientDiagnostics;
private SyncGroupsRestOperations _syncGroupRestClient;
private ClientDiagnostics _virtualClusterClientDiagnostics;
private VirtualClustersRestOperations _virtualClusterRestClient;
private ClientDiagnostics _sqlServerServersClientDiagnostics;
private ServersRestOperations _sqlServerServersRestClient;
+ private ClientDiagnostics _longTermRetentionBackupsClientDiagnostics;
+ private LongTermRetentionBackupsRestOperations _longTermRetentionBackupsRestClient;
+ private ClientDiagnostics _longTermRetentionManagedInstanceBackupsClientDiagnostics;
+ private LongTermRetentionManagedInstanceBackupsRestOperations _longTermRetentionManagedInstanceBackupsRestClient;
+ private ClientDiagnostics _managedInstanceClientDiagnostics;
+ private ManagedInstancesRestOperations _managedInstanceRestClient;
/// Initializes a new instance of the class for mocking.
protected SubscriptionExtensionClient()
@@ -61,20 +59,18 @@ internal SubscriptionExtensionClient(ArmClient client, ResourceIdentifier id) :
private InstancePoolsRestOperations InstancePoolRestClient => _instancePoolRestClient ??= new InstancePoolsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, GetApiVersionOrNull(InstancePool.ResourceType));
private ClientDiagnostics CapabilitiesClientDiagnostics => _capabilitiesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions);
private CapabilitiesRestOperations CapabilitiesRestClient => _capabilitiesRestClient ??= new CapabilitiesRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri);
- private ClientDiagnostics LongTermRetentionBackupsClientDiagnostics => _longTermRetentionBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions);
- private LongTermRetentionBackupsRestOperations LongTermRetentionBackupsRestClient => _longTermRetentionBackupsRestClient ??= new LongTermRetentionBackupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri);
- private ClientDiagnostics LongTermRetentionManagedInstanceBackupsClientDiagnostics => _longTermRetentionManagedInstanceBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions);
- private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri);
- private ClientDiagnostics ManagedInstanceClientDiagnostics => _managedInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstance.ResourceType.Namespace, DiagnosticOptions);
- private ManagedInstancesRestOperations ManagedInstanceRestClient => _managedInstanceRestClient ??= new ManagedInstancesRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, GetApiVersionOrNull(ManagedInstance.ResourceType));
- private ClientDiagnostics OperationsHealthClientDiagnostics => _operationsHealthClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions);
- private OperationsHealthRestOperations OperationsHealthRestClient => _operationsHealthRestClient ??= new OperationsHealthRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri);
private ClientDiagnostics SyncGroupClientDiagnostics => _syncGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", SyncGroup.ResourceType.Namespace, DiagnosticOptions);
private SyncGroupsRestOperations SyncGroupRestClient => _syncGroupRestClient ??= new SyncGroupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, GetApiVersionOrNull(SyncGroup.ResourceType));
private ClientDiagnostics VirtualClusterClientDiagnostics => _virtualClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", VirtualCluster.ResourceType.Namespace, DiagnosticOptions);
private VirtualClustersRestOperations VirtualClusterRestClient => _virtualClusterRestClient ??= new VirtualClustersRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, GetApiVersionOrNull(VirtualCluster.ResourceType));
private ClientDiagnostics SqlServerServersClientDiagnostics => _sqlServerServersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", SqlServer.ResourceType.Namespace, DiagnosticOptions);
private ServersRestOperations SqlServerServersRestClient => _sqlServerServersRestClient ??= new ServersRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, GetApiVersionOrNull(SqlServer.ResourceType));
+ private ClientDiagnostics LongTermRetentionBackupsClientDiagnostics => _longTermRetentionBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions);
+ private LongTermRetentionBackupsRestOperations LongTermRetentionBackupsRestClient => _longTermRetentionBackupsRestClient ??= new LongTermRetentionBackupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri);
+ private ClientDiagnostics LongTermRetentionManagedInstanceBackupsClientDiagnostics => _longTermRetentionManagedInstanceBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions);
+ private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri);
+ private ClientDiagnostics ManagedInstanceClientDiagnostics => _managedInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstance.ResourceType.Namespace, DiagnosticOptions);
+ private ManagedInstancesRestOperations ManagedInstanceRestClient => _managedInstanceRestClient ??= new ManagedInstancesRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, GetApiVersionOrNull(ManagedInstance.ResourceType));
private string GetApiVersionOrNull(ResourceType resourceType)
{
@@ -90,6 +86,22 @@ public virtual DeletedServerCollection GetDeletedServers(string locationName)
return new DeletedServerCollection(Client, Id, locationName);
}
+ /// Gets a collection of SubscriptionUsages in the SubscriptionUsage.
+ /// The name of the region where the resource is located.
+ /// An object representing collection of SubscriptionUsages and their operations over a SubscriptionUsage.
+ public virtual SubscriptionUsageCollection GetSubscriptionUsages(string locationName)
+ {
+ return new SubscriptionUsageCollection(Client, Id, locationName);
+ }
+
+ /// Gets a collection of SqlTimeZones in the SqlTimeZone.
+ /// The String to use.
+ /// An object representing collection of SqlTimeZones and their operations over a SqlTimeZone.
+ public virtual SqlTimeZoneCollection GetSqlTimeZones(string locationName)
+ {
+ return new SqlTimeZoneCollection(Client, Id, locationName);
+ }
+
/// Gets a collection of SubscriptionLongTermRetentionBackups in the SubscriptionLongTermRetentionBackup.
/// The location of the database.
/// The name of the server.
@@ -110,22 +122,6 @@ public virtual SubscriptionLongTermRetentionManagedInstanceBackupCollection GetS
return new SubscriptionLongTermRetentionManagedInstanceBackupCollection(Client, Id, locationName, managedInstanceName, databaseName);
}
- /// Gets a collection of SubscriptionUsages in the SubscriptionUsage.
- /// The name of the region where the resource is located.
- /// An object representing collection of SubscriptionUsages and their operations over a SubscriptionUsage.
- public virtual SubscriptionUsageCollection GetSubscriptionUsages(string locationName)
- {
- return new SubscriptionUsageCollection(Client, Id, locationName);
- }
-
- /// Gets a collection of SqlTimeZones in the SqlTimeZone.
- /// The String to use.
- /// An object representing collection of SqlTimeZones and their operations over a SqlTimeZone.
- public virtual SqlTimeZoneCollection GetSqlTimeZones(string locationName)
- {
- return new SqlTimeZoneCollection(Client, Id, locationName);
- }
-
///
/// Gets a list of all deleted servers in a subscription.
/// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers
@@ -343,25 +339,23 @@ public virtual Response GetByLocationCapability(string loc
}
///
- /// Lists the long term retention backups for a given location.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
- /// Operation Id: LongTermRetentionBackups_ListByLocation
+ /// Gets a collection of sync database ids.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
+ /// Operation Id: SyncGroups_ListSyncDatabaseIds
///
- /// The location of the database.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
+ /// The name of the region where the resource is located.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetLongTermRetentionBackupsByLocationAsync(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(string locationName, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
+ using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
scope.Start();
try
{
- var response = await LongTermRetentionBackupsRestClient.ListByLocationAsync(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await SyncGroupRestClient.ListSyncDatabaseIdsAsync(Id.SubscriptionId, locationName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -369,14 +363,14 @@ async Task> FirstPageFunc(int? pageSiz
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
+ using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
scope.Start();
try
{
- var response = await LongTermRetentionBackupsRestClient.ListByLocationNextPageAsync(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await SyncGroupRestClient.ListSyncDatabaseIdsNextPageAsync(nextLink, Id.SubscriptionId, locationName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -388,25 +382,23 @@ async Task> NextPageFunc(string nextLi
}
///
- /// Lists the long term retention backups for a given location.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
- /// Operation Id: LongTermRetentionBackups_ListByLocation
+ /// Gets a collection of sync database ids.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
+ /// Operation Id: SyncGroups_ListSyncDatabaseIds
///
- /// The location of the database.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
+ /// The name of the region where the resource is located.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetLongTermRetentionBackupsByLocation(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetSyncDatabaseIdsSyncGroups(string locationName, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
+ using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
scope.Start();
try
{
- var response = LongTermRetentionBackupsRestClient.ListByLocation(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = SyncGroupRestClient.ListSyncDatabaseIds(Id.SubscriptionId, locationName, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -414,14 +406,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
+ using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
scope.Start();
try
{
- var response = LongTermRetentionBackupsRestClient.ListByLocationNextPage(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = SyncGroupRestClient.ListSyncDatabaseIdsNextPage(nextLink, Id.SubscriptionId, locationName, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -433,26 +425,22 @@ Page NextPageFunc(string nextLink, int? pag
}
///
- /// Lists the long term retention backups for a given server.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups
- /// Operation Id: LongTermRetentionBackups_ListByServer
+ /// Gets a list of all virtualClusters in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
+ /// Operation Id: VirtualClusters_List
///
- /// The location of the database.
- /// The name of the server.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetLongTermRetentionBackupsByServerAsync(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetVirtualClustersAsync(CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
+ using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
scope.Start();
try
{
- var response = await LongTermRetentionBackupsRestClient.ListByServerAsync(Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await VirtualClusterRestClient.ListAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -460,14 +448,14 @@ async Task> FirstPageFunc(int? pageSiz
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
+ using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
scope.Start();
try
{
- var response = await LongTermRetentionBackupsRestClient.ListByServerNextPageAsync(nextLink, Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await VirtualClusterRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -479,26 +467,22 @@ async Task> NextPageFunc(string nextLi
}
///
- /// Lists the long term retention backups for a given server.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups
- /// Operation Id: LongTermRetentionBackups_ListByServer
+ /// Gets a list of all virtualClusters in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
+ /// Operation Id: VirtualClusters_List
///
- /// The location of the database.
- /// The name of the server.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetLongTermRetentionBackupsByServer(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetVirtualClusters(CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
+ using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
scope.Start();
try
{
- var response = LongTermRetentionBackupsRestClient.ListByServer(Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = VirtualClusterRestClient.List(Id.SubscriptionId, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -506,14 +490,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
+ using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
scope.Start();
try
{
- var response = LongTermRetentionBackupsRestClient.ListByServerNextPage(nextLink, Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = VirtualClusterRestClient.ListNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -525,26 +509,23 @@ Page NextPageFunc(string nextLink, int? pag
}
///
- /// Lists the long term retention backups for a given managed instance.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups
- /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByInstance
+ /// Gets a list of all servers in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
+ /// Operation Id: Servers_List
///
- /// The location of the database.
- /// The name of the managed instance.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
+ /// The child resources to include in the response.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsByInstanceAsync(string locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetSqlServersAsync(string expand = null, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
+ using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
scope.Start();
try
{
- var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByInstanceAsync(Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await SqlServerServersRestClient.ListAsync(Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -552,14 +533,14 @@ async Task> FirstPageFu
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
+ using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
scope.Start();
try
{
- var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByInstanceNextPageAsync(nextLink, Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await SqlServerServersRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -571,26 +552,23 @@ async Task> NextPageFun
}
///
- /// Lists the long term retention backups for a given managed instance.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups
- /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByInstance
+ /// Gets a list of all servers in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
+ /// Operation Id: Servers_List
///
- /// The location of the database.
- /// The name of the managed instance.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
+ /// The child resources to include in the response.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetLongTermRetentionManagedInstanceBackupsByInstance(string locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetSqlServers(string expand = null, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
+ using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
scope.Start();
try
{
- var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByInstance(Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = SqlServerServersRestClient.List(Id.SubscriptionId, expand, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -598,14 +576,14 @@ Page FirstPageFunc(int? page
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
+ using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
scope.Start();
try
{
- var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByInstanceNextPage(nextLink, Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = SqlServerServersRestClient.ListNextPage(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -617,113 +595,71 @@ Page NextPageFunc(string nex
}
///
- /// Lists the long term retention backups for managed databases in a given location.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups
- /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByLocation
+ /// Determines whether a resource can be created with the specified name.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
+ /// Operation Id: Servers_CheckNameAvailability
///
- /// The location of the database.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
+ /// The name availability request parameters.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsByLocationAsync(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ public virtual async Task> CheckNameAvailabilityServerAsync(CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.CheckNameAvailabilityServer");
+ scope.Start();
+ try
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
- scope.Start();
- try
- {
- var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByLocationAsync(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ var response = await SqlServerServersRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, parameters, cancellationToken).ConfigureAwait(false);
+ return response;
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ catch (Exception e)
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
- scope.Start();
- try
- {
- var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByLocationNextPageAsync(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ scope.Failed(e);
+ throw;
}
- return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
}
///
- /// Lists the long term retention backups for managed databases in a given location.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups
- /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByLocation
+ /// Determines whether a resource can be created with the specified name.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
+ /// Operation Id: Servers_CheckNameAvailability
///
- /// The location of the database.
- /// Whether or not to only get the latest backup for each database.
- /// Whether to query against just live databases, just deleted databases, or all databases.
+ /// The name availability request parameters.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetLongTermRetentionManagedInstanceBackupsByLocation(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
+ public virtual Response CheckNameAvailabilityServer(CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.CheckNameAvailabilityServer");
+ scope.Start();
+ try
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
- scope.Start();
- try
- {
- var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByLocation(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ var response = SqlServerServersRestClient.CheckNameAvailability(Id.SubscriptionId, parameters, cancellationToken);
+ return response;
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ catch (Exception e)
{
- using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
- scope.Start();
- try
- {
- var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByLocationNextPage(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ scope.Failed(e);
+ throw;
}
- return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
}
///
- /// Gets a list of all managed instances in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances
- /// Operation Id: ManagedInstances_List
+ /// Lists the long term retention backups for a given location.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
+ /// Operation Id: LongTermRetentionBackups_ListByLocation
///
- /// The child resources to include in the response.
+ /// The location of the database.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetManagedInstancesAsync(string expand = null, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetLongTermRetentionBackupsByLocationAsync(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
scope.Start();
try
{
- var response = await ManagedInstanceRestClient.ListAsync(Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionBackupsRestClient.ListByLocationAsync(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -731,14 +667,14 @@ async Task> FirstPageFunc(int? pageSizeHint)
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
scope.Start();
try
{
- var response = await ManagedInstanceRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionBackupsRestClient.ListByLocationNextPageAsync(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -750,23 +686,25 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHin
}
///
- /// Gets a list of all managed instances in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances
- /// Operation Id: ManagedInstances_List
+ /// Lists the long term retention backups for a given location.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
+ /// Operation Id: LongTermRetentionBackups_ListByLocation
///
- /// The child resources to include in the response.
+ /// The location of the database.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetManagedInstances(string expand = null, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetLongTermRetentionBackupsByLocation(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
scope.Start();
try
{
- var response = ManagedInstanceRestClient.List(Id.SubscriptionId, expand, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionBackupsRestClient.ListByLocation(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -774,14 +712,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByLocation");
scope.Start();
try
{
- var response = ManagedInstanceRestClient.ListNextPage(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionBackupsRestClient.ListByLocationNextPage(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -793,23 +731,26 @@ Page NextPageFunc(string nextLink, int? pageSizeHint)
}
///
- /// Gets a service operation health status.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/operationsHealth
- /// Operation Id: OperationsHealth_ListByLocation
+ /// Lists the long term retention backups for a given server.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups
+ /// Operation Id: LongTermRetentionBackups_ListByServer
///
- /// The name of the region where the resource is located.
+ /// The location of the database.
+ /// The name of the server.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetOperationsHealthsByLocationAsync(string locationName, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetLongTermRetentionBackupsByServerAsync(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = OperationsHealthClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetOperationsHealthsByLocation");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
scope.Start();
try
{
- var response = await OperationsHealthRestClient.ListByLocationAsync(Id.SubscriptionId, locationName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionBackupsRestClient.ListByServerAsync(Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -817,14 +758,14 @@ async Task> FirstPageFunc(int? pageSizeHint)
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = OperationsHealthClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetOperationsHealthsByLocation");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
scope.Start();
try
{
- var response = await OperationsHealthRestClient.ListByLocationNextPageAsync(nextLink, Id.SubscriptionId, locationName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionBackupsRestClient.ListByServerNextPageAsync(nextLink, Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -836,23 +777,26 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHi
}
///
- /// Gets a service operation health status.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/operationsHealth
- /// Operation Id: OperationsHealth_ListByLocation
+ /// Lists the long term retention backups for a given server.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups
+ /// Operation Id: LongTermRetentionBackups_ListByServer
///
- /// The name of the region where the resource is located.
+ /// The location of the database.
+ /// The name of the server.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetOperationsHealthsByLocation(string locationName, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetLongTermRetentionBackupsByServer(string locationName, string longTermRetentionServerName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = OperationsHealthClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetOperationsHealthsByLocation");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
scope.Start();
try
{
- var response = OperationsHealthRestClient.ListByLocation(Id.SubscriptionId, locationName, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionBackupsRestClient.ListByServer(Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -860,14 +804,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = OperationsHealthClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetOperationsHealthsByLocation");
+ using var scope = LongTermRetentionBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionBackupsByServer");
scope.Start();
try
{
- var response = OperationsHealthRestClient.ListByLocationNextPage(nextLink, Id.SubscriptionId, locationName, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionBackupsRestClient.ListByServerNextPage(nextLink, Id.SubscriptionId, locationName, longTermRetentionServerName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -879,23 +823,26 @@ Page NextPageFunc(string nextLink, int? pageSizeHint)
}
///
- /// Gets a collection of sync database ids.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
- /// Operation Id: SyncGroups_ListSyncDatabaseIds
+ /// Lists the long term retention backups for a given managed instance.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups
+ /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByInstance
///
- /// The name of the region where the resource is located.
+ /// The location of the database.
+ /// The name of the managed instance.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(string locationName, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsByInstanceAsync(string locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
scope.Start();
try
{
- var response = await SyncGroupRestClient.ListSyncDatabaseIdsAsync(Id.SubscriptionId, locationName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByInstanceAsync(Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -903,14 +850,14 @@ async Task> FirstPageFunc(int? pageSizeHint)
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
scope.Start();
try
{
- var response = await SyncGroupRestClient.ListSyncDatabaseIdsNextPageAsync(nextLink, Id.SubscriptionId, locationName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByInstanceNextPageAsync(nextLink, Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -922,23 +869,26 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
}
///
- /// Gets a collection of sync database ids.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
- /// Operation Id: SyncGroups_ListSyncDatabaseIds
+ /// Lists the long term retention backups for a given managed instance.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups
+ /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByInstance
///
- /// The name of the region where the resource is located.
+ /// The location of the database.
+ /// The name of the managed instance.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetSyncDatabaseIdsSyncGroups(string locationName, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetLongTermRetentionManagedInstanceBackupsByInstance(string locationName, string managedInstanceName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
scope.Start();
try
{
- var response = SyncGroupRestClient.ListSyncDatabaseIds(Id.SubscriptionId, locationName, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByInstance(Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -946,14 +896,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = SyncGroupClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSyncDatabaseIdsSyncGroups");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByInstance");
scope.Start();
try
{
- var response = SyncGroupRestClient.ListSyncDatabaseIdsNextPage(nextLink, Id.SubscriptionId, locationName, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByInstanceNextPage(nextLink, Id.SubscriptionId, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -965,22 +915,25 @@ Page NextPageFunc(string nextLink, int? pageSizeHint)
}
///
- /// Gets a list of all virtualClusters in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
- /// Operation Id: VirtualClusters_List
+ /// Lists the long term retention backups for managed databases in a given location.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups
+ /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByLocation
///
+ /// The location of the database.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetVirtualClustersAsync(CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetLongTermRetentionManagedInstanceBackupsByLocationAsync(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
scope.Start();
try
{
- var response = await VirtualClusterRestClient.ListAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByLocationAsync(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -988,14 +941,14 @@ async Task> FirstPageFunc(int? pageSizeHint)
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
scope.Start();
try
{
- var response = await VirtualClusterRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await LongTermRetentionManagedInstanceBackupsRestClient.ListByLocationNextPageAsync(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1007,22 +960,25 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint
}
///
- /// Gets a list of all virtualClusters in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
- /// Operation Id: VirtualClusters_List
+ /// Lists the long term retention backups for managed databases in a given location.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups
+ /// Operation Id: LongTermRetentionManagedInstanceBackups_ListByLocation
///
+ /// The location of the database.
+ /// Whether or not to only get the latest backup for each database.
+ /// Whether to query against just live databases, just deleted databases, or all databases.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetVirtualClusters(CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetLongTermRetentionManagedInstanceBackupsByLocation(string locationName, bool? onlyLatestPerDatabase = null, DatabaseState? databaseState = null, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
scope.Start();
try
{
- var response = VirtualClusterRestClient.List(Id.SubscriptionId, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByLocation(Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1030,14 +986,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = VirtualClusterClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetVirtualClusters");
+ using var scope = LongTermRetentionManagedInstanceBackupsClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetLongTermRetentionManagedInstanceBackupsByLocation");
scope.Start();
try
{
- var response = VirtualClusterRestClient.ListNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new VirtualCluster(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = LongTermRetentionManagedInstanceBackupsRestClient.ListByLocationNextPage(nextLink, Id.SubscriptionId, locationName, onlyLatestPerDatabase, databaseState, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new SubscriptionLongTermRetentionManagedInstanceBackup(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1049,23 +1005,23 @@ Page NextPageFunc(string nextLink, int? pageSizeHint)
}
///
- /// Gets a list of all servers in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
- /// Operation Id: Servers_List
+ /// Gets a list of all managed instances in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances
+ /// Operation Id: ManagedInstances_List
///
/// The child resources to include in the response.
/// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetSqlServersAsync(string expand = null, CancellationToken cancellationToken = default)
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetManagedInstancesAsync(string expand = null, CancellationToken cancellationToken = default)
{
- async Task> FirstPageFunc(int? pageSizeHint)
+ async Task> FirstPageFunc(int? pageSizeHint)
{
- using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
+ using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
scope.Start();
try
{
- var response = await SqlServerServersRestClient.ListAsync(Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await ManagedInstanceRestClient.ListAsync(Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1073,14 +1029,14 @@ async Task> FirstPageFunc(int? pageSizeHint)
throw;
}
}
- async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
+ using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
scope.Start();
try
{
- var response = await SqlServerServersRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = await ManagedInstanceRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1092,23 +1048,23 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
}
///
- /// Gets a list of all servers in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
- /// Operation Id: Servers_List
+ /// Gets a list of all managed instances in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances
+ /// Operation Id: ManagedInstances_List
///
/// The child resources to include in the response.
/// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetSqlServers(string expand = null, CancellationToken cancellationToken = default)
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetManagedInstances(string expand = null, CancellationToken cancellationToken = default)
{
- Page FirstPageFunc(int? pageSizeHint)
+ Page FirstPageFunc(int? pageSizeHint)
{
- using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
+ using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
scope.Start();
try
{
- var response = SqlServerServersRestClient.List(Id.SubscriptionId, expand, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = ManagedInstanceRestClient.List(Id.SubscriptionId, expand, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1116,14 +1072,14 @@ Page FirstPageFunc(int? pageSizeHint)
throw;
}
}
- Page NextPageFunc(string nextLink, int? pageSizeHint)
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
{
- using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetSqlServers");
+ using var scope = ManagedInstanceClientDiagnostics.CreateScope("SubscriptionExtensionClient.GetManagedInstances");
scope.Start();
try
{
- var response = SqlServerServersRestClient.ListNextPage(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken);
- return Page.FromValues(response.Value.Value.Select(value => new SqlServer(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ var response = ManagedInstanceRestClient.ListNextPage(nextLink, Id.SubscriptionId, expand, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse());
}
catch (Exception e)
{
@@ -1133,51 +1089,5 @@ Page NextPageFunc(string nextLink, int? pageSizeHint)
}
return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
}
-
- ///
- /// Determines whether a resource can be created with the specified name.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
- /// Operation Id: Servers_CheckNameAvailability
- ///
- /// The name availability request parameters.
- /// The cancellation token to use.
- public virtual async Task> CheckNameAvailabilityServerAsync(CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
- {
- using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.CheckNameAvailabilityServer");
- scope.Start();
- try
- {
- var response = await SqlServerServersRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, parameters, cancellationToken).ConfigureAwait(false);
- return response;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Determines whether a resource can be created with the specified name.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
- /// Operation Id: Servers_CheckNameAvailability
- ///
- /// The name availability request parameters.
- /// The cancellation token to use.
- public virtual Response CheckNameAvailabilityServer(CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
- {
- using var scope = SqlServerServersClientDiagnostics.CreateScope("SubscriptionExtensionClient.CheckNameAvailabilityServer");
- scope.Start();
- try
- {
- var response = SqlServerServersRestClient.CheckNameAvailability(Id.SubscriptionId, parameters, cancellationToken);
- return response;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
}
}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensions.cs
index beb142a6f7b3..21f0fe7bf3e9 100644
--- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensions.cs
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensions.cs
@@ -73,6 +73,96 @@ public static Response GetDeletedServer(this Subscription subscri
return subscription.GetDeletedServers(locationName).Get(deletedServerName, cancellationToken);
}
+ /// Gets a collection of SubscriptionUsages in the SubscriptionUsage.
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// An object representing collection of SubscriptionUsages and their operations over a SubscriptionUsage.
+ public static SubscriptionUsageCollection GetSubscriptionUsages(this Subscription subscription, string locationName)
+ {
+ Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
+
+ return GetExtensionClient(subscription).GetSubscriptionUsages(locationName);
+ }
+
+ ///
+ /// Gets a subscription usage metric.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}
+ /// Operation Id: SubscriptionUsages_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// Name of usage metric to return.
+ /// The cancellation token to use.
+ /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public static async Task> GetSubscriptionUsageAsync(this Subscription subscription, string locationName, string usageName, CancellationToken cancellationToken = default)
+ {
+ return await subscription.GetSubscriptionUsages(locationName).GetAsync(usageName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets a subscription usage metric.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}
+ /// Operation Id: SubscriptionUsages_Get
+ ///
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// Name of usage metric to return.
+ /// The cancellation token to use.
+ /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public static Response GetSubscriptionUsage(this Subscription subscription, string locationName, string usageName, CancellationToken cancellationToken = default)
+ {
+ return subscription.GetSubscriptionUsages(locationName).Get(usageName, cancellationToken);
+ }
+
+ /// Gets a collection of SqlTimeZones in the SqlTimeZone.
+ /// The instance the method will execute against.
+ /// The String to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// An object representing collection of SqlTimeZones and their operations over a SqlTimeZone.
+ public static SqlTimeZoneCollection GetSqlTimeZones(this Subscription subscription, string locationName)
+ {
+ Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
+
+ return GetExtensionClient(subscription).GetSqlTimeZones(locationName);
+ }
+
+ ///
+ /// Gets a managed instance time zone.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}
+ /// Operation Id: TimeZones_Get
+ ///
+ /// The instance the method will execute against.
+ /// The String to use.
+ /// The String to use.
+ /// The cancellation token to use.
+ /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public static async Task> GetSqlTimeZoneAsync(this Subscription subscription, string locationName, string timeZoneId, CancellationToken cancellationToken = default)
+ {
+ return await subscription.GetSqlTimeZones(locationName).GetAsync(timeZoneId, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets a managed instance time zone.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}
+ /// Operation Id: TimeZones_Get
+ ///
+ /// The instance the method will execute against.
+ /// The String to use.
+ /// The String to use.
+ /// The cancellation token to use.
+ /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public static Response GetSqlTimeZone(this Subscription subscription, string locationName, string timeZoneId, CancellationToken cancellationToken = default)
+ {
+ return subscription.GetSqlTimeZones(locationName).Get(timeZoneId, cancellationToken);
+ }
+
/// Gets a collection of SubscriptionLongTermRetentionBackups in the SubscriptionLongTermRetentionBackup.
/// The instance the method will execute against.
/// The location of the database.
@@ -179,96 +269,6 @@ public static Response GetSu
return subscription.GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName).Get(backupName, cancellationToken);
}
- /// Gets a collection of SubscriptionUsages in the SubscriptionUsage.
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// An object representing collection of SubscriptionUsages and their operations over a SubscriptionUsage.
- public static SubscriptionUsageCollection GetSubscriptionUsages(this Subscription subscription, string locationName)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(subscription).GetSubscriptionUsages(locationName);
- }
-
- ///
- /// Gets a subscription usage metric.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}
- /// Operation Id: SubscriptionUsages_Get
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// Name of usage metric to return.
- /// The cancellation token to use.
- /// or is an empty string, and was expected to be non-empty.
- /// or is null.
- public static async Task> GetSubscriptionUsageAsync(this Subscription subscription, string locationName, string usageName, CancellationToken cancellationToken = default)
- {
- return await subscription.GetSubscriptionUsages(locationName).GetAsync(usageName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets a subscription usage metric.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}
- /// Operation Id: SubscriptionUsages_Get
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// Name of usage metric to return.
- /// The cancellation token to use.
- /// or is an empty string, and was expected to be non-empty.
- /// or is null.
- public static Response GetSubscriptionUsage(this Subscription subscription, string locationName, string usageName, CancellationToken cancellationToken = default)
- {
- return subscription.GetSubscriptionUsages(locationName).Get(usageName, cancellationToken);
- }
-
- /// Gets a collection of SqlTimeZones in the SqlTimeZone.
- /// The instance the method will execute against.
- /// The String to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// An object representing collection of SqlTimeZones and their operations over a SqlTimeZone.
- public static SqlTimeZoneCollection GetSqlTimeZones(this Subscription subscription, string locationName)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(subscription).GetSqlTimeZones(locationName);
- }
-
- ///
- /// Gets a managed instance time zone.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}
- /// Operation Id: TimeZones_Get
- ///
- /// The instance the method will execute against.
- /// The String to use.
- /// The String to use.
- /// The cancellation token to use.
- /// or is an empty string, and was expected to be non-empty.
- /// or is null.
- public static async Task> GetSqlTimeZoneAsync(this Subscription subscription, string locationName, string timeZoneId, CancellationToken cancellationToken = default)
- {
- return await subscription.GetSqlTimeZones(locationName).GetAsync(timeZoneId, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets a managed instance time zone.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}
- /// Operation Id: TimeZones_Get
- ///
- /// The instance the method will execute against.
- /// The String to use.
- /// The String to use.
- /// The cancellation token to use.
- /// or is an empty string, and was expected to be non-empty.
- /// or is null.
- public static Response GetSqlTimeZone(this Subscription subscription, string locationName, string timeZoneId, CancellationToken cancellationToken = default)
- {
- return subscription.GetSqlTimeZones(locationName).Get(timeZoneId, cancellationToken);
- }
-
///
/// Gets a list of all deleted servers in a subscription.
/// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers
@@ -357,6 +357,128 @@ public static Response GetByLocationCapability(this Subscr
return GetExtensionClient(subscription).GetByLocationCapability(locationName, include, cancellationToken);
}
+ ///
+ /// Gets a collection of sync database ids.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
+ /// Operation Id: SyncGroups_ListSyncDatabaseIds
+ ///
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(this Subscription subscription, string locationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
+
+ return GetExtensionClient(subscription).GetSyncDatabaseIdsSyncGroupsAsync(locationName, cancellationToken);
+ }
+
+ ///
+ /// Gets a collection of sync database ids.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
+ /// Operation Id: SyncGroups_ListSyncDatabaseIds
+ ///
+ /// The instance the method will execute against.
+ /// The name of the region where the resource is located.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetSyncDatabaseIdsSyncGroups(this Subscription subscription, string locationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
+
+ return GetExtensionClient(subscription).GetSyncDatabaseIdsSyncGroups(locationName, cancellationToken);
+ }
+
+ ///
+ /// Gets a list of all virtualClusters in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
+ /// Operation Id: VirtualClusters_List
+ ///
+ /// The instance the method will execute against.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetVirtualClustersAsync(this Subscription subscription, CancellationToken cancellationToken = default)
+ {
+ return GetExtensionClient(subscription).GetVirtualClustersAsync(cancellationToken);
+ }
+
+ ///
+ /// Gets a list of all virtualClusters in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
+ /// Operation Id: VirtualClusters_List
+ ///
+ /// The instance the method will execute against.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetVirtualClusters(this Subscription subscription, CancellationToken cancellationToken = default)
+ {
+ return GetExtensionClient(subscription).GetVirtualClusters(cancellationToken);
+ }
+
+ ///
+ /// Gets a list of all servers in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
+ /// Operation Id: Servers_List
+ ///
+ /// The instance the method will execute against.
+ /// The child resources to include in the response.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public static AsyncPageable GetSqlServersAsync(this Subscription subscription, string expand = null, CancellationToken cancellationToken = default)
+ {
+ return GetExtensionClient(subscription).GetSqlServersAsync(expand, cancellationToken);
+ }
+
+ ///
+ /// Gets a list of all servers in the subscription.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
+ /// Operation Id: Servers_List
+ ///
+ /// The instance the method will execute against.
+ /// The child resources to include in the response.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public static Pageable GetSqlServers(this Subscription subscription, string expand = null, CancellationToken cancellationToken = default)
+ {
+ return GetExtensionClient(subscription).GetSqlServers(expand, cancellationToken);
+ }
+
+ ///
+ /// Determines whether a resource can be created with the specified name.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
+ /// Operation Id: Servers_CheckNameAvailability
+ ///
+ /// The instance the method will execute against.
+ /// The name availability request parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public static async Task> CheckNameAvailabilityServerAsync(this Subscription subscription, CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ return await GetExtensionClient(subscription).CheckNameAvailabilityServerAsync(parameters, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Determines whether a resource can be created with the specified name.
+ /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
+ /// Operation Id: Servers_CheckNameAvailability
+ ///
+ /// The instance the method will execute against.
+ /// The name availability request parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public static Response CheckNameAvailabilityServer(this Subscription subscription, CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ return GetExtensionClient(subscription).CheckNameAvailabilityServer(parameters, cancellationToken);
+ }
+
///
/// Lists the long term retention backups for a given location.
/// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups
@@ -552,163 +674,5 @@ public static Pageable GetManagedInstances(this Subscription su
{
return GetExtensionClient(subscription).GetManagedInstances(expand, cancellationToken);
}
-
- ///
- /// Gets a service operation health status.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/operationsHealth
- /// Operation Id: OperationsHealth_ListByLocation
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// An async collection of that may take multiple service requests to iterate over.
- public static AsyncPageable GetOperationsHealthsByLocationAsync(this Subscription subscription, string locationName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(subscription).GetOperationsHealthsByLocationAsync(locationName, cancellationToken);
- }
-
- ///
- /// Gets a service operation health status.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/operationsHealth
- /// Operation Id: OperationsHealth_ListByLocation
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// A collection of that may take multiple service requests to iterate over.
- public static Pageable GetOperationsHealthsByLocation(this Subscription subscription, string locationName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(subscription).GetOperationsHealthsByLocation(locationName, cancellationToken);
- }
-
- ///
- /// Gets a collection of sync database ids.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
- /// Operation Id: SyncGroups_ListSyncDatabaseIds
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// An async collection of that may take multiple service requests to iterate over.
- public static AsyncPageable GetSyncDatabaseIdsSyncGroupsAsync(this Subscription subscription, string locationName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(subscription).GetSyncDatabaseIdsSyncGroupsAsync(locationName, cancellationToken);
- }
-
- ///
- /// Gets a collection of sync database ids.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds
- /// Operation Id: SyncGroups_ListSyncDatabaseIds
- ///
- /// The instance the method will execute against.
- /// The name of the region where the resource is located.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- /// A collection of that may take multiple service requests to iterate over.
- public static Pageable GetSyncDatabaseIdsSyncGroups(this Subscription subscription, string locationName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(locationName, nameof(locationName));
-
- return GetExtensionClient(subscription).GetSyncDatabaseIdsSyncGroups(locationName, cancellationToken);
- }
-
- ///
- /// Gets a list of all virtualClusters in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
- /// Operation Id: VirtualClusters_List
- ///
- /// The instance the method will execute against.
- /// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public static AsyncPageable GetVirtualClustersAsync(this Subscription subscription, CancellationToken cancellationToken = default)
- {
- return GetExtensionClient(subscription).GetVirtualClustersAsync(cancellationToken);
- }
-
- ///
- /// Gets a list of all virtualClusters in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters
- /// Operation Id: VirtualClusters_List
- ///
- /// The instance the method will execute against.
- /// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public static Pageable GetVirtualClusters(this Subscription subscription, CancellationToken cancellationToken = default)
- {
- return GetExtensionClient(subscription).GetVirtualClusters(cancellationToken);
- }
-
- ///
- /// Gets a list of all servers in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
- /// Operation Id: Servers_List
- ///
- /// The instance the method will execute against.
- /// The child resources to include in the response.
- /// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public static AsyncPageable GetSqlServersAsync(this Subscription subscription, string expand = null, CancellationToken cancellationToken = default)
- {
- return GetExtensionClient(subscription).GetSqlServersAsync(expand, cancellationToken);
- }
-
- ///
- /// Gets a list of all servers in the subscription.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers
- /// Operation Id: Servers_List
- ///
- /// The instance the method will execute against.
- /// The child resources to include in the response.
- /// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public static Pageable GetSqlServers(this Subscription subscription, string expand = null, CancellationToken cancellationToken = default)
- {
- return GetExtensionClient(subscription).GetSqlServers(expand, cancellationToken);
- }
-
- ///
- /// Determines whether a resource can be created with the specified name.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
- /// Operation Id: Servers_CheckNameAvailability
- ///
- /// The instance the method will execute against.
- /// The name availability request parameters.
- /// The cancellation token to use.
- /// is null.
- public static async Task> CheckNameAvailabilityServerAsync(this Subscription subscription, CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(parameters, nameof(parameters));
-
- return await GetExtensionClient(subscription).CheckNameAvailabilityServerAsync(parameters, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Determines whether a resource can be created with the specified name.
- /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability
- /// Operation Id: Servers_CheckNameAvailability
- ///
- /// The instance the method will execute against.
- /// The name availability request parameters.
- /// The cancellation token to use.
- /// is null.
- public static Response CheckNameAvailabilityServer(this Subscription subscription, CheckNameAvailabilityRequest parameters, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(parameters, nameof(parameters));
-
- return GetExtensionClient(subscription).CheckNameAvailabilityServer(parameters, cancellationToken);
- }
}
}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/IPv6FirewallRule.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/IPv6FirewallRule.cs
new file mode 100644
index 000000000000..b2223ba37c9d
--- /dev/null
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/IPv6FirewallRule.cs
@@ -0,0 +1,185 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Core;
+
+namespace Azure.ResourceManager.Sql
+{
+ /// A Class representing a IPv6FirewallRule along with the instance operations that can be performed on it.
+ public partial class IPv6FirewallRule : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string serverName, string firewallRuleName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _iPv6FirewallRuleClientDiagnostics;
+ private readonly IPv6FirewallRulesRestOperations _iPv6FirewallRuleRestClient;
+ private readonly IPv6FirewallRuleData _data;
+
+ /// Initializes a new instance of the class for mocking.
+ protected IPv6FirewallRule()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal IPv6FirewallRule(ArmClient client, IPv6FirewallRuleData data) : this(client, new ResourceIdentifier(data.Id))
+ {
+ HasData = true;
+ _data = data;
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal IPv6FirewallRule(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _iPv6FirewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ResourceType.Namespace, DiagnosticOptions);
+ TryGetApiVersion(ResourceType, out string iPv6FirewallRuleApiVersion);
+ _iPv6FirewallRuleRestClient = new IPv6FirewallRulesRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, iPv6FirewallRuleApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.Sql/servers/ipv6FirewallRules";
+
+ /// Gets whether or not the current instance has data.
+ public virtual bool HasData { get; }
+
+ /// Gets the data representing this Feature.
+ /// Throws if there is no data loaded in the current instance.
+ public virtual IPv6FirewallRuleData Data
+ {
+ get
+ {
+ if (!HasData)
+ throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
+ return _data;
+ }
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
+ }
+
+ ///
+ /// Gets an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRule.Get");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new IPv6FirewallRule(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRule.Get");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new IPv6FirewallRule(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Deletes an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Delete
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRule.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new SqlArmOperation(response);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Deletes an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Delete
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRule.Delete");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new SqlArmOperation(response);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/IPv6FirewallRuleCollection.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/IPv6FirewallRuleCollection.cs
new file mode 100644
index 000000000000..6464847fb016
--- /dev/null
+++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/IPv6FirewallRuleCollection.cs
@@ -0,0 +1,388 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Core;
+
+namespace Azure.ResourceManager.Sql
+{
+ /// A class representing collection of IPv6FirewallRule and their operations over its parent.
+ public partial class IPv6FirewallRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _iPv6FirewallRuleClientDiagnostics;
+ private readonly IPv6FirewallRulesRestOperations _iPv6FirewallRuleRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected IPv6FirewallRuleCollection()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the parent resource that is the target of operations.
+ internal IPv6FirewallRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _iPv6FirewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", IPv6FirewallRule.ResourceType.Namespace, DiagnosticOptions);
+ TryGetApiVersion(IPv6FirewallRule.ResourceType, out string iPv6FirewallRuleApiVersion);
+ _iPv6FirewallRuleRestClient = new IPv6FirewallRulesRestOperations(Pipeline, DiagnosticOptions.ApplicationId, BaseUri, iPv6FirewallRuleApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != SqlServer.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SqlServer.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Creates or updates an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_CreateOrUpdate
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" 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 firewall rule.
+ /// The required parameters for creating or updating an IPv6 firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string firewallRuleName, IPv6FirewallRuleData parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, parameters, cancellationToken).ConfigureAwait(false);
+ var operation = new SqlArmOperation(Response.FromValue(new IPv6FirewallRule(Client, response), response.GetRawResponse()));
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Creates or updates an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_CreateOrUpdate
+ ///
+ /// "F:Azure.WaitUntil.Completed" if the method should wait to return until the long-running operation has completed on the service; "F:Azure.WaitUntil.Started" 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 firewall rule.
+ /// The required parameters for creating or updating an IPv6 firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string firewallRuleName, IPv6FirewallRuleData parameters, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+ Argument.AssertNotNull(parameters, nameof(parameters));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, parameters, cancellationToken);
+ var operation = new SqlArmOperation(Response.FromValue(new IPv6FirewallRule(Client, response), response.GetRawResponse()));
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The name of the firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string firewallRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new IPv6FirewallRule(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets an IPv6 firewall rule.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The name of the firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string firewallRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new IPv6FirewallRule(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets a list of IPv6 firewall rules.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules
+ /// Operation Id: IPv6FirewallRules_ListByServer
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.ListByServerAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new IPv6FirewallRule(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.ListByServerNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new IPv6FirewallRule(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ ///
+ /// Gets a list of IPv6 firewall rules.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules
+ /// Operation Id: IPv6FirewallRules_ListByServer
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.ListByServer(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new IPv6FirewallRule(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.GetAll");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.ListByServerNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new IPv6FirewallRule(Client, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The name of the firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await GetIfExistsAsync(firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The name of the firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string firewallRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = GetIfExists(firewallRuleName, cancellationToken: cancellationToken);
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The name of the firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _iPv6FirewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return Response.FromValue(null, response.GetRawResponse());
+ return Response.FromValue(new IPv6FirewallRule(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}
+ /// Operation Id: IPv6FirewallRules_Get
+ ///
+ /// The name of the firewall rule.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response GetIfExists(string firewallRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName));
+
+ using var scope = _iPv6FirewallRuleClientDiagnostics.CreateScope("IPv6FirewallRuleCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _iPv6FirewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return Response.FromValue(null, response.GetRawResponse());
+ return Response.FromValue(new IPv6FirewallRule(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ IEnumerator IEnumerable