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..2456d529431e 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,22 +1645,6 @@ 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. - /// 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 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. 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 6be081c4ed10..b88ea6a90a0a 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 d56848cfc879..94914c6b4578 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/ResourceGroupExtensions.cs @@ -47,6 +47,35 @@ public static InstancePoolCollection GetInstancePools(this ResourceGroup resourc return GetExtensionClient(resourceGroup).GetInstancePools(); } + /// 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 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 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 collection of ResourceGroupLongTermRetentionBackups in the ResourceGroupLongTermRetentionBackup. /// The instance the method will execute against. /// The location of the database. @@ -89,35 +118,6 @@ public static ManagedInstanceCollection GetManagedInstances(this ResourceGroup r return GetExtensionClient(resourceGroup).GetManagedInstances(); } - /// 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 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 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(); - } - /// /// 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 98efcf9cc7ab..684bdead50ba 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(InstancePoolClientDiagnostics, 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(CapabilitiesClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); - private ClientDiagnostics LongTermRetentionBackupsClientDiagnostics => _longTermRetentionBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions); - private LongTermRetentionBackupsRestOperations LongTermRetentionBackupsRestClient => _longTermRetentionBackupsRestClient ??= new LongTermRetentionBackupsRestOperations(LongTermRetentionBackupsClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); - private ClientDiagnostics LongTermRetentionManagedInstanceBackupsClientDiagnostics => _longTermRetentionManagedInstanceBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions); - private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); - private ClientDiagnostics ManagedInstanceClientDiagnostics => _managedInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstance.ResourceType.Namespace, DiagnosticOptions); - private ManagedInstancesRestOperations ManagedInstanceRestClient => _managedInstanceRestClient ??= new ManagedInstancesRestOperations(ManagedInstanceClientDiagnostics, 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(OperationsHealthClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); private ClientDiagnostics SyncGroupClientDiagnostics => _syncGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", SyncGroup.ResourceType.Namespace, DiagnosticOptions); private SyncGroupsRestOperations SyncGroupRestClient => _syncGroupRestClient ??= new SyncGroupsRestOperations(SyncGroupClientDiagnostics, 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(VirtualClusterClientDiagnostics, 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(SqlServerServersClientDiagnostics, 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(LongTermRetentionBackupsClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); + private ClientDiagnostics LongTermRetentionManagedInstanceBackupsClientDiagnostics => _longTermRetentionManagedInstanceBackupsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions); + private LongTermRetentionManagedInstanceBackupsRestOperations LongTermRetentionManagedInstanceBackupsRestClient => _longTermRetentionManagedInstanceBackupsRestClient ??= new LongTermRetentionManagedInstanceBackupsRestOperations(LongTermRetentionManagedInstanceBackupsClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); + private ClientDiagnostics ManagedInstanceClientDiagnostics => _managedInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstance.ResourceType.Namespace, DiagnosticOptions); + private ManagedInstancesRestOperations ManagedInstanceRestClient => _managedInstanceRestClient ??= new ManagedInstancesRestOperations(ManagedInstanceClientDiagnostics, 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 async virtual 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 async virtual 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 a76e748e14e0..2d9c1e82e1b3 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Extensions/SubscriptionExtensions.cs @@ -41,6 +41,32 @@ public static DeletedServerCollection GetDeletedServers(this Subscription subscr return GetExtensionClient(subscription).GetDeletedServers(locationName); } + /// 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 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 collection of SubscriptionLongTermRetentionBackups in the SubscriptionLongTermRetentionBackup. /// The instance the method will execute against. /// The location of the database. @@ -75,32 +101,6 @@ public static SubscriptionLongTermRetentionManagedInstanceBackupCollection GetSu return GetExtensionClient(subscription).GetSubscriptionLongTermRetentionManagedInstanceBackups(locationName, managedInstanceName, databaseName); } - /// 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 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 list of all deleted servers in a subscription. /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers @@ -189,6 +189,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 async static 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 @@ -384,163 +506,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 async static 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/InstancePool.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePool.cs index 9acc70c33c91..48d0b74eed6b 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePool.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/InstancePool.cs @@ -32,10 +32,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _instancePoolClientDiagnostics; private readonly InstancePoolsRestOperations _instancePoolRestClient; - private readonly ClientDiagnostics _managedInstanceClientDiagnostics; - private readonly ManagedInstancesRestOperations _managedInstanceRestClient; private readonly ClientDiagnostics _usagesClientDiagnostics; private readonly UsagesRestOperations _usagesRestClient; + private readonly ClientDiagnostics _managedInstanceClientDiagnostics; + private readonly ManagedInstancesRestOperations _managedInstanceRestClient; private readonly InstancePoolData _data; /// Initializes a new instance of the class for mocking. @@ -60,11 +60,11 @@ internal InstancePool(ArmClient client, ResourceIdentifier id) : base(client, id _instancePoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ResourceType.Namespace, DiagnosticOptions); TryGetApiVersion(ResourceType, out string instancePoolApiVersion); _instancePoolRestClient = new InstancePoolsRestOperations(_instancePoolClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, instancePoolApiVersion); + _usagesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions); + _usagesRestClient = new UsagesRestOperations(_usagesClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); _managedInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ManagedInstance.ResourceType.Namespace, DiagnosticOptions); TryGetApiVersion(ManagedInstance.ResourceType, out string managedInstanceApiVersion); _managedInstanceRestClient = new ManagedInstancesRestOperations(_managedInstanceClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri, managedInstanceApiVersion); - _usagesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, DiagnosticOptions); - _usagesRestClient = new UsagesRestOperations(_usagesClientDiagnostics, Pipeline, DiagnosticOptions.ApplicationId, BaseUri); #if DEBUG ValidateResourceId(Id); #endif @@ -195,23 +195,23 @@ public virtual ArmOperation Delete(bool waitForCompletion, CancellationToken can } /// - /// Gets a list of all managed instances in an instance pool. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances - /// Operation Id: ManagedInstances_ListByInstancePool + /// Gets all instance pool usage metrics + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages + /// Operation Id: Usages_ListByInstancePool /// - /// The child resources to include in the response. + /// Optional request parameter to include managed instance usages within the instance pool. /// 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 GetUsagesAsync(bool? expandChildren = null, CancellationToken cancellationToken = default) { - async Task> FirstPageFunc(int? pageSizeHint) + async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); + using var scope = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); scope.Start(); try { - var response = await _managedInstanceRestClient.ListByInstancePoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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 _usagesRestClient.ListByInstancePoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -219,14 +219,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("InstancePool.GetManagedInstances"); + using var scope = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); scope.Start(); try { - var response = await _managedInstanceRestClient.ListByInstancePoolNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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 _usagesRestClient.ListByInstancePoolNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -238,23 +238,23 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHin } /// - /// Gets a list of all managed instances in an instance pool. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances - /// Operation Id: ManagedInstances_ListByInstancePool + /// Gets all instance pool usage metrics + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages + /// Operation Id: Usages_ListByInstancePool /// - /// The child resources to include in the response. + /// Optional request parameter to include managed instance usages within the instance pool. /// 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 GetUsages(bool? expandChildren = null, CancellationToken cancellationToken = default) { - Page FirstPageFunc(int? pageSizeHint) + Page FirstPageFunc(int? pageSizeHint) { - using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); + using var scope = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); scope.Start(); try { - var response = _managedInstanceRestClient.ListByInstancePool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse()); + var response = _usagesRestClient.ListByInstancePool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -262,14 +262,14 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - Page NextPageFunc(string nextLink, int? pageSizeHint) + Page NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); + using var scope = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); scope.Start(); try { - var response = _managedInstanceRestClient.ListByInstancePoolNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse()); + var response = _usagesRestClient.ListByInstancePoolNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -281,23 +281,23 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) } /// - /// Gets all instance pool usage metrics - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages - /// Operation Id: Usages_ListByInstancePool + /// Gets a list of all managed instances in an instance pool. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances + /// Operation Id: ManagedInstances_ListByInstancePool /// - /// Optional request parameter to include managed instance usages within the instance pool. + /// 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 GetUsagesAsync(bool? expandChildren = 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 = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); + using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); scope.Start(); try { - var response = await _usagesRestClient.ListByInstancePoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + var response = await _managedInstanceRestClient.ListByInstancePoolAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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) { @@ -305,14 +305,14 @@ async Task> FirstPageFunc(int? pageSizeHint) throw; } } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) + async Task> NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); + using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); scope.Start(); try { - var response = await _usagesRestClient.ListByInstancePoolNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + var response = await _managedInstanceRestClient.ListByInstancePoolNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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) { @@ -324,23 +324,23 @@ async Task> NextPageFunc(string nextLink, int? pageSizeH } /// - /// Gets all instance pool usage metrics - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages - /// Operation Id: Usages_ListByInstancePool + /// Gets a list of all managed instances in an instance pool. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances + /// Operation Id: ManagedInstances_ListByInstancePool /// - /// Optional request parameter to include managed instance usages within the instance pool. + /// 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 GetUsages(bool? expandChildren = 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 = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); + using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); scope.Start(); try { - var response = _usagesRestClient.ListByInstancePool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + var response = _managedInstanceRestClient.ListByInstancePool(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -348,14 +348,14 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - Page NextPageFunc(string nextLink, int? pageSizeHint) + Page NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = _usagesClientDiagnostics.CreateScope("InstancePool.GetUsages"); + using var scope = _managedInstanceClientDiagnostics.CreateScope("InstancePool.GetManagedInstances"); scope.Start(); try { - var response = _usagesRestClient.ListByInstancePoolNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expandChildren, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + var response = _managedInstanceRestClient.ListByInstancePoolNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ManagedInstance(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstance.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstance.cs index 17ae01af37a7..3d5b8594d403 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstance.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstance.cs @@ -436,6 +436,150 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } + /// + /// Creates a TDE certificate for a given server. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates + /// Operation Id: ManagedInstanceTdeCertificates_Create + /// + /// Waits for the completion of the long running operations. + /// The requested TDE certificate to be created or updated. + /// The cancellation token to use. + /// is null. + public async virtual Task CreateManagedInstanceTdeCertificateAsync(bool waitForCompletion, TdeCertificate parameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + using var scope = _managedInstanceTdeCertificatesClientDiagnostics.CreateScope("ManagedInstance.CreateManagedInstanceTdeCertificate"); + scope.Start(); + try + { + var response = await _managedInstanceTdeCertificatesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters, cancellationToken).ConfigureAwait(false); + var operation = new SqlArmOperation(_managedInstanceTdeCertificatesClientDiagnostics, Pipeline, _managedInstanceTdeCertificatesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters).Request, response, OperationFinalStateVia.Location); + if (waitForCompletion) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a TDE certificate for a given server. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates + /// Operation Id: ManagedInstanceTdeCertificates_Create + /// + /// Waits for the completion of the long running operations. + /// The requested TDE certificate to be created or updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateManagedInstanceTdeCertificate(bool waitForCompletion, TdeCertificate parameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + using var scope = _managedInstanceTdeCertificatesClientDiagnostics.CreateScope("ManagedInstance.CreateManagedInstanceTdeCertificate"); + scope.Start(); + try + { + var response = _managedInstanceTdeCertificatesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters, cancellationToken); + var operation = new SqlArmOperation(_managedInstanceTdeCertificatesClientDiagnostics, Pipeline, _managedInstanceTdeCertificatesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters).Request, response, OperationFinalStateVia.Location); + if (waitForCompletion) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a server trust groups by instance name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups + /// Operation Id: ServerTrustGroups_ListByInstance + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetServerTrustGroupsAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); + scope.Start(); + try + { + var response = await _serverTrustGroupRestClient.ListByInstanceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); + scope.Start(); + try + { + var response = await _serverTrustGroupRestClient.ListByInstanceNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Gets a server trust groups by instance name. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups + /// Operation Id: ServerTrustGroups_ListByInstance + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetServerTrustGroups(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); + scope.Start(); + try + { + var response = _serverTrustGroupRestClient.ListByInstance(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); + scope.Start(); + try + { + var response = _serverTrustGroupRestClient.ListByInstanceNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + /// /// Get top resource consuming queries of a managed instance. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries @@ -588,150 +732,6 @@ public virtual ArmOperation Failover(bool waitForCompletion, ReplicaType? replic } } - /// - /// Creates a TDE certificate for a given server. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates - /// Operation Id: ManagedInstanceTdeCertificates_Create - /// - /// Waits for the completion of the long running operations. - /// The requested TDE certificate to be created or updated. - /// The cancellation token to use. - /// is null. - public async virtual Task CreateManagedInstanceTdeCertificateAsync(bool waitForCompletion, TdeCertificate parameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(parameters, nameof(parameters)); - - using var scope = _managedInstanceTdeCertificatesClientDiagnostics.CreateScope("ManagedInstance.CreateManagedInstanceTdeCertificate"); - scope.Start(); - try - { - var response = await _managedInstanceTdeCertificatesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters, cancellationToken).ConfigureAwait(false); - var operation = new SqlArmOperation(_managedInstanceTdeCertificatesClientDiagnostics, Pipeline, _managedInstanceTdeCertificatesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters).Request, response, OperationFinalStateVia.Location); - if (waitForCompletion) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a TDE certificate for a given server. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates - /// Operation Id: ManagedInstanceTdeCertificates_Create - /// - /// Waits for the completion of the long running operations. - /// The requested TDE certificate to be created or updated. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateManagedInstanceTdeCertificate(bool waitForCompletion, TdeCertificate parameters, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(parameters, nameof(parameters)); - - using var scope = _managedInstanceTdeCertificatesClientDiagnostics.CreateScope("ManagedInstance.CreateManagedInstanceTdeCertificate"); - scope.Start(); - try - { - var response = _managedInstanceTdeCertificatesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters, cancellationToken); - var operation = new SqlArmOperation(_managedInstanceTdeCertificatesClientDiagnostics, Pipeline, _managedInstanceTdeCertificatesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, parameters).Request, response, OperationFinalStateVia.Location); - if (waitForCompletion) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a server trust groups by instance name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups - /// Operation Id: ServerTrustGroups_ListByInstance - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetServerTrustGroupsAsync(CancellationToken cancellationToken = default) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); - scope.Start(); - try - { - var response = await _serverTrustGroupRestClient.ListByInstanceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); - scope.Start(); - try - { - var response = await _serverTrustGroupRestClient.ListByInstanceNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Gets a server trust groups by instance name. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups - /// Operation Id: ServerTrustGroups_ListByInstance - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetServerTrustGroups(CancellationToken cancellationToken = default) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); - scope.Start(); - try - { - var response = _serverTrustGroupRestClient.ListByInstance(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - Page NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _serverTrustGroupClientDiagnostics.CreateScope("ManagedInstance.GetServerTrustGroups"); - scope.Start(); - try - { - var response = _serverTrustGroupRestClient.ListByInstanceNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ServerTrustGroup(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); - } - /// /// Add a tag to the current resource. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs index f821cf3ab94c..2808ba461ee6 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/ManagedInstanceData.cs @@ -67,12 +67,14 @@ public ManagedInstanceData(AzureLocation location) : base(location) /// Specifies maintenance configuration id to apply to this managed instance. /// List of private endpoint connections on a managed instance. /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - /// The storage account type used to store backups for this instance. The options are LRS (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). + /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). /// Whether or not the multi-az is enabled. /// The resource id of a user assigned identity to be used by default. /// A CMK URI of the key to use for encryption. /// The Azure Active Directory administrator of the server. - internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, Models.Sku sku, ManagedInstancePropertiesProvisioningState? provisioningState, ManagedServerCreateMode? managedInstanceCreateMode, string fullyQualifiedDomainName, string administratorLogin, string administratorLoginPassword, string subnetId, string state, ManagedInstanceLicenseType? licenseType, int? vCores, int? storageSizeInGB, string collation, string dnsZone, string dnsZonePartner, bool? publicDataEndpointEnabled, string sourceManagedInstanceId, DateTimeOffset? restorePointInTime, ManagedInstanceProxyOverride? proxyOverride, string timezoneId, string instancePoolId, string maintenanceConfigurationId, IReadOnlyList privateEndpointConnections, string minimalTlsVersion, StorageAccountType? storageAccountType, bool? zoneRedundant, string primaryUserAssignedIdentityId, string keyId, ManagedInstanceExternalAdministrator administrators) : base(id, name, type, systemData, tags, location) + /// The managed instance's service principal. + internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, Models.Sku sku, ManagedInstancePropertiesProvisioningState? provisioningState, ManagedServerCreateMode? managedInstanceCreateMode, string fullyQualifiedDomainName, string administratorLogin, string administratorLoginPassword, string subnetId, string state, ManagedInstanceLicenseType? licenseType, int? vCores, int? storageSizeInGB, string collation, string dnsZone, string dnsZonePartner, bool? publicDataEndpointEnabled, string sourceManagedInstanceId, DateTimeOffset? restorePointInTime, ManagedInstanceProxyOverride? proxyOverride, string timezoneId, string instancePoolId, string maintenanceConfigurationId, IReadOnlyList privateEndpointConnections, string minimalTlsVersion, BackupStorageRedundancy? currentBackupStorageRedundancy, BackupStorageRedundancy? requestedBackupStorageRedundancy, bool? zoneRedundant, string primaryUserAssignedIdentityId, string keyId, ManagedInstanceExternalAdministrator administrators, ServicePrincipal servicePrincipal) : base(id, name, type, systemData, tags, location) { Identity = identity; Sku = sku; @@ -98,11 +100,13 @@ internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType ty MaintenanceConfigurationId = maintenanceConfigurationId; PrivateEndpointConnections = privateEndpointConnections; MinimalTlsVersion = minimalTlsVersion; - StorageAccountType = storageAccountType; + CurrentBackupStorageRedundancy = currentBackupStorageRedundancy; + RequestedBackupStorageRedundancy = requestedBackupStorageRedundancy; ZoneRedundant = zoneRedundant; PrimaryUserAssignedIdentityId = primaryUserAssignedIdentityId; KeyId = keyId; Administrators = administrators; + ServicePrincipal = servicePrincipal; } /// The Azure Active Directory identity of the managed instance. @@ -166,8 +170,10 @@ internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType ty public IReadOnlyList PrivateEndpointConnections { get; } /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. public string MinimalTlsVersion { get; set; } - /// The storage account type used to store backups for this instance. The options are LRS (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). - public StorageAccountType? StorageAccountType { get; set; } + /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + public BackupStorageRedundancy? CurrentBackupStorageRedundancy { get; } + /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + public BackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } /// Whether or not the multi-az is enabled. public bool? ZoneRedundant { get; set; } /// The resource id of a user assigned identity to be used by default. @@ -176,5 +182,7 @@ internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType ty public string KeyId { get; set; } /// The Azure Active Directory administrator of the server. public ManagedInstanceExternalAdministrator Administrators { get; set; } + /// The managed instance's service principal. + public ServicePrincipal ServicePrincipal { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/BackupStorageRedundancy.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/BackupStorageRedundancy.cs index f91e87ee069b..128880e8eb89 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/BackupStorageRedundancy.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/BackupStorageRedundancy.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Sql.Models { - /// The storage redundancy type of the copied backup. + /// The storage account type used to store backups for this database. public readonly partial struct BackupStorageRedundancy : IEquatable { private readonly string _value; @@ -25,6 +25,7 @@ public BackupStorageRedundancy(string value) private const string GeoValue = "Geo"; private const string LocalValue = "Local"; private const string ZoneValue = "Zone"; + private const string GeoZoneValue = "GeoZone"; /// Geo. public static BackupStorageRedundancy Geo { get; } = new BackupStorageRedundancy(GeoValue); @@ -32,6 +33,8 @@ public BackupStorageRedundancy(string value) public static BackupStorageRedundancy Local { get; } = new BackupStorageRedundancy(LocalValue); /// Zone. public static BackupStorageRedundancy Zone { get; } = new BackupStorageRedundancy(ZoneValue); + /// GeoZone. + public static BackupStorageRedundancy GeoZone { get; } = new BackupStorageRedundancy(GeoZoneValue); /// Determines if two values are the same. public static bool operator ==(BackupStorageRedundancy left, BackupStorageRedundancy right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CopyLongTermRetentionBackupOptions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CopyLongTermRetentionBackupOptions.cs index ee8fb9555623..ebef9f837b63 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CopyLongTermRetentionBackupOptions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CopyLongTermRetentionBackupOptions.cs @@ -26,6 +26,6 @@ public CopyLongTermRetentionBackupOptions() /// The name of the database owns the copied backup. public string TargetDatabaseName { get; set; } /// The storage redundancy type of the copied backup. - public TargetBackupStorageRedundancy? TargetBackupStorageRedundancy { get; set; } + public BackupStorageRedundancy? TargetBackupStorageRedundancy { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CurrentBackupStorageRedundancy.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CurrentBackupStorageRedundancy.cs deleted file mode 100644 index a4bb6a17adda..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/CurrentBackupStorageRedundancy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The storage account type used to store backups for this database. - public readonly partial struct CurrentBackupStorageRedundancy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CurrentBackupStorageRedundancy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string GeoValue = "Geo"; - private const string LocalValue = "Local"; - private const string ZoneValue = "Zone"; - - /// Geo. - public static CurrentBackupStorageRedundancy Geo { get; } = new CurrentBackupStorageRedundancy(GeoValue); - /// Local. - public static CurrentBackupStorageRedundancy Local { get; } = new CurrentBackupStorageRedundancy(LocalValue); - /// Zone. - public static CurrentBackupStorageRedundancy Zone { get; } = new CurrentBackupStorageRedundancy(ZoneValue); - /// Determines if two values are the same. - public static bool operator ==(CurrentBackupStorageRedundancy left, CurrentBackupStorageRedundancy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CurrentBackupStorageRedundancy left, CurrentBackupStorageRedundancy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CurrentBackupStorageRedundancy(string value) => new CurrentBackupStorageRedundancy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CurrentBackupStorageRedundancy other && Equals(other); - /// - public bool Equals(CurrentBackupStorageRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentity.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentity.Serialization.cs new file mode 100644 index 000000000000..33eb1d3253eb --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentity.Serialization.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class DatabaseIdentity : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(DelegatedResources)) + { + writer.WritePropertyName("delegatedResources"); + writer.WriteStartObject(); + foreach (var item in DelegatedResources) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static DatabaseIdentity DeserializeDatabaseIdentity(JsonElement element) + { + Optional type = default; + Optional tenantId = default; + Optional> userAssignedIdentities = default; + Optional> delegatedResources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = new DatabaseIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tenantId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("userAssignedIdentities")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.ToString())); + } + userAssignedIdentities = dictionary; + continue; + } + if (property.NameEquals("delegatedResources")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, Delegation.DeserializeDelegation(property0.Value)); + } + delegatedResources = dictionary; + continue; + } + } + return new DatabaseIdentity(Optional.ToNullable(type), Optional.ToNullable(tenantId), Optional.ToDictionary(userAssignedIdentities), Optional.ToDictionary(delegatedResources)); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentity.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentity.cs new file mode 100644 index 000000000000..947fd98db6d8 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentity.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Azure Active Directory identity configuration for a resource. + public partial class DatabaseIdentity + { + /// Initializes a new instance of DatabaseIdentity. + public DatabaseIdentity() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + DelegatedResources = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of DatabaseIdentity. + /// The identity type. + /// The Azure Active Directory tenant id. + /// The resource ids of the user assigned identities to use. + /// Resources delegated to the database - Internal Use Only. + internal DatabaseIdentity(DatabaseIdentityType? type, Guid? tenantId, IDictionary userAssignedIdentities, IDictionary delegatedResources) + { + Type = type; + TenantId = tenantId; + UserAssignedIdentities = userAssignedIdentities; + DelegatedResources = delegatedResources; + } + + /// The identity type. + public DatabaseIdentityType? Type { get; set; } + /// The Azure Active Directory tenant id. + public Guid? TenantId { get; } + /// The resource ids of the user assigned identities to use. + public IDictionary UserAssignedIdentities { get; } + /// Resources delegated to the database - Internal Use Only. + public IDictionary DelegatedResources { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentityType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentityType.cs new file mode 100644 index 000000000000..263a17f7b722 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseIdentityType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Sql.Models +{ + /// The identity type. + public readonly partial struct DatabaseIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatabaseIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string UserAssignedValue = "UserAssigned"; + + /// None. + public static DatabaseIdentityType None { get; } = new DatabaseIdentityType(NoneValue); + /// UserAssigned. + public static DatabaseIdentityType UserAssigned { get; } = new DatabaseIdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseIdentityType left, DatabaseIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseIdentityType left, DatabaseIdentityType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DatabaseIdentityType(string value) => new DatabaseIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseIdentityType other && Equals(other); + /// + public bool Equals(DatabaseIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseStatus.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseStatus.cs index 0f2a12829f4c..6080fa5ff97d 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseStatus.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/DatabaseStatus.cs @@ -43,6 +43,9 @@ public DatabaseStatus(string value) private const string OfflineChangingDwPerformanceTiersValue = "OfflineChangingDwPerformanceTiers"; private const string OnlineChangingDwPerformanceTiersValue = "OnlineChangingDwPerformanceTiers"; private const string DisabledValue = "Disabled"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string StartingValue = "Starting"; /// Online. public static DatabaseStatus Online { get; } = new DatabaseStatus(OnlineValue); @@ -86,6 +89,12 @@ public DatabaseStatus(string value) public static DatabaseStatus OnlineChangingDwPerformanceTiers { get; } = new DatabaseStatus(OnlineChangingDwPerformanceTiersValue); /// Disabled. public static DatabaseStatus Disabled { get; } = new DatabaseStatus(DisabledValue); + /// Stopping. + public static DatabaseStatus Stopping { get; } = new DatabaseStatus(StoppingValue); + /// Stopped. + public static DatabaseStatus Stopped { get; } = new DatabaseStatus(StoppedValue); + /// Starting. + public static DatabaseStatus Starting { get; } = new DatabaseStatus(StartingValue); /// Determines if two values are the same. public static bool operator ==(DatabaseStatus left, DatabaseStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Delegation.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Delegation.Serialization.cs new file mode 100644 index 000000000000..fbf22ed21450 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Delegation.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class Delegation : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"); + writer.WriteStringValue(ResourceId); + } + writer.WriteEndObject(); + } + + internal static Delegation DeserializeDelegation(JsonElement element) + { + Optional resourceId = default; + Optional tenantId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId")) + { + resourceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + } + return new Delegation(resourceId.Value, Optional.ToNullable(tenantId)); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Delegation.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Delegation.cs new file mode 100644 index 000000000000..f70659e50303 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/Delegation.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Delegated Resource Properties - Internal Use Only. + public partial class Delegation + { + /// Initializes a new instance of Delegation. + public Delegation() + { + } + + /// Initializes a new instance of Delegation. + /// The resource id of the source resource - Internal Use Only. + /// AAD tenant guid of the source resource identity - Internal Use Only. + internal Delegation(string resourceId, Guid? tenantId) + { + ResourceId = resourceId; + TenantId = tenantId; + } + + /// The resource id of the source resource - Internal Use Only. + public string ResourceId { get; set; } + /// AAD tenant guid of the source resource identity - Internal Use Only. + public Guid? TenantId { get; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceData.Serialization.cs index e08512322c53..a55730ae11ac 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceData.Serialization.cs @@ -127,10 +127,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("minimalTlsVersion"); writer.WriteStringValue(MinimalTlsVersion); } - if (Optional.IsDefined(StorageAccountType)) + if (Optional.IsDefined(RequestedBackupStorageRedundancy)) { - writer.WritePropertyName("storageAccountType"); - writer.WriteStringValue(StorageAccountType.Value.ToString()); + writer.WritePropertyName("requestedBackupStorageRedundancy"); + writer.WriteStringValue(RequestedBackupStorageRedundancy.Value.ToString()); } if (Optional.IsDefined(ZoneRedundant)) { @@ -152,6 +152,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("administrators"); writer.WriteObjectValue(Administrators); } + if (Optional.IsDefined(ServicePrincipal)) + { + writer.WritePropertyName("servicePrincipal"); + writer.WriteObjectValue(ServicePrincipal); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -188,11 +193,13 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e Optional maintenanceConfigurationId = default; Optional> privateEndpointConnections = default; Optional minimalTlsVersion = default; - Optional storageAccountType = default; + Optional currentBackupStorageRedundancy = default; + Optional requestedBackupStorageRedundancy = default; Optional zoneRedundant = default; Optional primaryUserAssignedIdentityId = default; Optional keyId = default; Optional administrators = default; + Optional servicePrincipal = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("identity")) @@ -420,14 +427,24 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e minimalTlsVersion = property0.Value.GetString(); continue; } - if (property0.NameEquals("storageAccountType")) + if (property0.NameEquals("currentBackupStorageRedundancy")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + currentBackupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("requestedBackupStorageRedundancy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - storageAccountType = new StorageAccountType(property0.Value.GetString()); + requestedBackupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); continue; } if (property0.NameEquals("zoneRedundant")) @@ -460,11 +477,21 @@ internal static ManagedInstanceData DeserializeManagedInstanceData(JsonElement e administrators = ManagedInstanceExternalAdministrator.DeserializeManagedInstanceExternalAdministrator(property0.Value); continue; } + if (property0.NameEquals("servicePrincipal")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + servicePrincipal = ServicePrincipal.DeserializeServicePrincipal(property0.Value); + continue; + } } continue; } } - return new ManagedInstanceData(id, name, type, systemData, tags, location, identity, sku.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(managedInstanceCreateMode), fullyQualifiedDomainName.Value, administratorLogin.Value, administratorLoginPassword.Value, subnetId.Value, state.Value, Optional.ToNullable(licenseType), Optional.ToNullable(vCores), Optional.ToNullable(storageSizeInGB), collation.Value, dnsZone.Value, dnsZonePartner.Value, Optional.ToNullable(publicDataEndpointEnabled), sourceManagedInstanceId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(proxyOverride), timezoneId.Value, instancePoolId.Value, maintenanceConfigurationId.Value, Optional.ToList(privateEndpointConnections), minimalTlsVersion.Value, Optional.ToNullable(storageAccountType), Optional.ToNullable(zoneRedundant), primaryUserAssignedIdentityId.Value, keyId.Value, administrators.Value); + return new ManagedInstanceData(id, name, type, systemData, tags, location, identity, sku.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(managedInstanceCreateMode), fullyQualifiedDomainName.Value, administratorLogin.Value, administratorLoginPassword.Value, subnetId.Value, state.Value, Optional.ToNullable(licenseType), Optional.ToNullable(vCores), Optional.ToNullable(storageSizeInGB), collation.Value, dnsZone.Value, dnsZonePartner.Value, Optional.ToNullable(publicDataEndpointEnabled), sourceManagedInstanceId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(proxyOverride), timezoneId.Value, instancePoolId.Value, maintenanceConfigurationId.Value, Optional.ToList(privateEndpointConnections), minimalTlsVersion.Value, Optional.ToNullable(currentBackupStorageRedundancy), Optional.ToNullable(requestedBackupStorageRedundancy), Optional.ToNullable(zoneRedundant), primaryUserAssignedIdentityId.Value, keyId.Value, administrators.Value, servicePrincipal.Value); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs index 309aee81a204..4e611e194278 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstancePropertiesProvisioningState.cs @@ -28,6 +28,15 @@ public ManagedInstancePropertiesProvisioningState(string value) private const string UnknownValue = "Unknown"; private const string SucceededValue = "Succeeded"; private const string FailedValue = "Failed"; + private const string AcceptedValue = "Accepted"; + private const string CreatedValue = "Created"; + private const string DeletedValue = "Deleted"; + private const string UnrecognizedValue = "Unrecognized"; + private const string RunningValue = "Running"; + private const string CanceledValue = "Canceled"; + private const string NotSpecifiedValue = "NotSpecified"; + private const string RegisteringValue = "Registering"; + private const string TimedOutValue = "TimedOut"; /// Creating. public static ManagedInstancePropertiesProvisioningState Creating { get; } = new ManagedInstancePropertiesProvisioningState(CreatingValue); @@ -41,6 +50,24 @@ public ManagedInstancePropertiesProvisioningState(string value) public static ManagedInstancePropertiesProvisioningState Succeeded { get; } = new ManagedInstancePropertiesProvisioningState(SucceededValue); /// Failed. public static ManagedInstancePropertiesProvisioningState Failed { get; } = new ManagedInstancePropertiesProvisioningState(FailedValue); + /// Accepted. + public static ManagedInstancePropertiesProvisioningState Accepted { get; } = new ManagedInstancePropertiesProvisioningState(AcceptedValue); + /// Created. + public static ManagedInstancePropertiesProvisioningState Created { get; } = new ManagedInstancePropertiesProvisioningState(CreatedValue); + /// Deleted. + public static ManagedInstancePropertiesProvisioningState Deleted { get; } = new ManagedInstancePropertiesProvisioningState(DeletedValue); + /// Unrecognized. + public static ManagedInstancePropertiesProvisioningState Unrecognized { get; } = new ManagedInstancePropertiesProvisioningState(UnrecognizedValue); + /// Running. + public static ManagedInstancePropertiesProvisioningState Running { get; } = new ManagedInstancePropertiesProvisioningState(RunningValue); + /// Canceled. + public static ManagedInstancePropertiesProvisioningState Canceled { get; } = new ManagedInstancePropertiesProvisioningState(CanceledValue); + /// NotSpecified. + public static ManagedInstancePropertiesProvisioningState NotSpecified { get; } = new ManagedInstancePropertiesProvisioningState(NotSpecifiedValue); + /// Registering. + public static ManagedInstancePropertiesProvisioningState Registering { get; } = new ManagedInstancePropertiesProvisioningState(RegisteringValue); + /// TimedOut. + public static ManagedInstancePropertiesProvisioningState TimedOut { get; } = new ManagedInstancePropertiesProvisioningState(TimedOutValue); /// Determines if two values are the same. public static bool operator ==(ManagedInstancePropertiesProvisioningState left, ManagedInstancePropertiesProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.Serialization.cs index 8debb26aa6a0..a84a8be91a75 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.Serialization.cs @@ -125,10 +125,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("minimalTlsVersion"); writer.WriteStringValue(MinimalTlsVersion); } - if (Optional.IsDefined(StorageAccountType)) + if (Optional.IsDefined(RequestedBackupStorageRedundancy)) { - writer.WritePropertyName("storageAccountType"); - writer.WriteStringValue(StorageAccountType.Value.ToString()); + writer.WritePropertyName("requestedBackupStorageRedundancy"); + writer.WriteStringValue(RequestedBackupStorageRedundancy.Value.ToString()); } if (Optional.IsDefined(ZoneRedundant)) { @@ -150,6 +150,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("administrators"); writer.WriteObjectValue(Administrators); } + if (Optional.IsDefined(ServicePrincipal)) + { + writer.WritePropertyName("servicePrincipal"); + writer.WriteObjectValue(ServicePrincipal); + } writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.cs index 4a5bc04d89b9..0b39d6e09bf2 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ManagedInstanceUpdateOptions.cs @@ -85,8 +85,10 @@ public ManagedInstanceUpdateOptions() public IReadOnlyList PrivateEndpointConnections { get; } /// Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. public string MinimalTlsVersion { get; set; } - /// The storage account type used to store backups for this instance. The options are LRS (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). - public StorageAccountType? StorageAccountType { get; set; } + /// The storage account type used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + public BackupStorageRedundancy? CurrentBackupStorageRedundancy { get; } + /// The storage account type to be used to store backups for this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + public BackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } /// Whether or not the multi-az is enabled. public bool? ZoneRedundant { get; set; } /// The resource id of a user assigned identity to be used by default. @@ -95,5 +97,7 @@ public ManagedInstanceUpdateOptions() public string KeyId { get; set; } /// The Azure Active Directory administrator of the server. public ManagedInstanceExternalAdministrator Administrators { get; set; } + /// The managed instance's service principal. + public ServicePrincipal ServicePrincipal { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealth.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealth.Serialization.cs deleted file mode 100644 index 4e98b638b99c..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealth.Serialization.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Sql.Models -{ - public partial class OperationsHealth : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static OperationsHealth DeserializeOperationsHealth(JsonElement element) - { - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - Optional name0 = default; - Optional health = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("systemData")) - { - systemData = JsonSerializer.Deserialize(property.Value.ToString()); - continue; - } - if (property.NameEquals("properties")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("name")) - { - name0 = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("health")) - { - health = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description")) - { - description = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new OperationsHealth(id, name, type, systemData, name0.Value, health.Value, description.Value); - } - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealth.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealth.cs deleted file mode 100644 index ced3b5ca590e..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealth.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Sql.Models -{ - /// Operations health status in a location. - public partial class OperationsHealth : ResourceData - { - /// Initializes a new instance of OperationsHealth. - public OperationsHealth() - { - } - - /// Initializes a new instance of OperationsHealth. - /// The id. - /// The name. - /// The type. - /// The systemData. - /// Operation name for the service. - /// Operation health status of the service. - /// Health status description. - internal OperationsHealth(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, string namePropertiesName, string health, string description) : base(id, name, type, systemData) - { - NamePropertiesName = namePropertiesName; - Health = health; - Description = description; - } - - /// Operation name for the service. - public string NamePropertiesName { get; } - /// Operation health status of the service. - public string Health { get; } - /// Health status description. - public string Description { get; } - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealthListResult.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealthListResult.Serialization.cs deleted file mode 100644 index e3c818cd1a17..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealthListResult.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Sql.Models -{ - internal partial class OperationsHealthListResult - { - internal static OperationsHealthListResult DeserializeOperationsHealthListResult(JsonElement element) - { - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(OperationsHealth.DeserializeOperationsHealth(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new OperationsHealthListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealthListResult.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealthListResult.cs deleted file mode 100644 index 5c2dd6138dcd..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/OperationsHealthListResult.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.Sql.Models -{ - /// A list of service health statuses in a location. - internal partial class OperationsHealthListResult - { - /// Initializes a new instance of OperationsHealthListResult. - internal OperationsHealthListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of OperationsHealthListResult. - /// Array of results. - /// Link to retrieve next page of results. - internal OperationsHealthListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Array of results. - public IReadOnlyList Value { get; } - /// Link to retrieve next page of results. - public string NextLink { get; } - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RequestedBackupStorageRedundancy.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RequestedBackupStorageRedundancy.cs deleted file mode 100644 index c607d93cbc8d..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RequestedBackupStorageRedundancy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The storage redundancy type of the copied backup. - public readonly partial struct RequestedBackupStorageRedundancy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RequestedBackupStorageRedundancy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string GeoValue = "Geo"; - private const string LocalValue = "Local"; - private const string ZoneValue = "Zone"; - - /// Geo. - public static RequestedBackupStorageRedundancy Geo { get; } = new RequestedBackupStorageRedundancy(GeoValue); - /// Local. - public static RequestedBackupStorageRedundancy Local { get; } = new RequestedBackupStorageRedundancy(LocalValue); - /// Zone. - public static RequestedBackupStorageRedundancy Zone { get; } = new RequestedBackupStorageRedundancy(ZoneValue); - /// Determines if two values are the same. - public static bool operator ==(RequestedBackupStorageRedundancy left, RequestedBackupStorageRedundancy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RequestedBackupStorageRedundancy left, RequestedBackupStorageRedundancy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RequestedBackupStorageRedundancy(string value) => new RequestedBackupStorageRedundancy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RequestedBackupStorageRedundancy other && Equals(other); - /// - public bool Equals(RequestedBackupStorageRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabaseData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabaseData.Serialization.cs index b7250790a683..ea48be3760d1 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabaseData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabaseData.Serialization.cs @@ -57,11 +57,10 @@ internal static RestorableDroppedDatabaseData DeserializeRestorableDroppedDataba SystemData systemData = default; Optional databaseName = default; Optional maxSizeBytes = default; - Optional elasticPoolId = default; Optional creationDate = default; Optional deletionDate = default; Optional earliestRestoreDate = default; - Optional backupStorageRedundancy = default; + Optional backupStorageRedundancy = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) @@ -138,11 +137,6 @@ internal static RestorableDroppedDatabaseData DeserializeRestorableDroppedDataba maxSizeBytes = property0.Value.GetInt64(); continue; } - if (property0.NameEquals("elasticPoolId")) - { - elasticPoolId = property0.Value.GetString(); - continue; - } if (property0.NameEquals("creationDate")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -180,14 +174,14 @@ internal static RestorableDroppedDatabaseData DeserializeRestorableDroppedDataba property0.ThrowNonNullablePropertyIsNull(); continue; } - backupStorageRedundancy = new RestorableDroppedDatabasePropertiesBackupStorageRedundancy(property0.Value.GetString()); + backupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); continue; } } continue; } } - return new RestorableDroppedDatabaseData(id, name, type, systemData, sku.Value, location.Value, Optional.ToDictionary(tags), databaseName.Value, Optional.ToNullable(maxSizeBytes), elasticPoolId.Value, Optional.ToNullable(creationDate), Optional.ToNullable(deletionDate), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(backupStorageRedundancy)); + return new RestorableDroppedDatabaseData(id, name, type, systemData, sku.Value, location.Value, Optional.ToDictionary(tags), databaseName.Value, Optional.ToNullable(maxSizeBytes), Optional.ToNullable(creationDate), Optional.ToNullable(deletionDate), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(backupStorageRedundancy)); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabasePropertiesBackupStorageRedundancy.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabasePropertiesBackupStorageRedundancy.cs deleted file mode 100644 index 58e9e1443239..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/RestorableDroppedDatabasePropertiesBackupStorageRedundancy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The storage account type used to store backups for this database. - public readonly partial struct RestorableDroppedDatabasePropertiesBackupStorageRedundancy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RestorableDroppedDatabasePropertiesBackupStorageRedundancy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string GeoValue = "Geo"; - private const string LocalValue = "Local"; - private const string ZoneValue = "Zone"; - - /// Geo. - public static RestorableDroppedDatabasePropertiesBackupStorageRedundancy Geo { get; } = new RestorableDroppedDatabasePropertiesBackupStorageRedundancy(GeoValue); - /// Local. - public static RestorableDroppedDatabasePropertiesBackupStorageRedundancy Local { get; } = new RestorableDroppedDatabasePropertiesBackupStorageRedundancy(LocalValue); - /// Zone. - public static RestorableDroppedDatabasePropertiesBackupStorageRedundancy Zone { get; } = new RestorableDroppedDatabasePropertiesBackupStorageRedundancy(ZoneValue); - /// Determines if two values are the same. - public static bool operator ==(RestorableDroppedDatabasePropertiesBackupStorageRedundancy left, RestorableDroppedDatabasePropertiesBackupStorageRedundancy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RestorableDroppedDatabasePropertiesBackupStorageRedundancy left, RestorableDroppedDatabasePropertiesBackupStorageRedundancy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RestorableDroppedDatabasePropertiesBackupStorageRedundancy(string value) => new RestorableDroppedDatabasePropertiesBackupStorageRedundancy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RestorableDroppedDatabasePropertiesBackupStorageRedundancy other && Equals(other); - /// - public bool Equals(RestorableDroppedDatabasePropertiesBackupStorageRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipal.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipal.Serialization.cs new file mode 100644 index 000000000000..cb50a10bd634 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipal.Serialization.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Sql.Models +{ + public partial class ServicePrincipal : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"); + writer.WriteStringValue(Type.Value.ToString()); + } + writer.WriteEndObject(); + } + + internal static ServicePrincipal DeserializeServicePrincipal(JsonElement element) + { + Optional principalId = default; + Optional clientId = default; + Optional tenantId = default; + Optional type = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId")) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId")) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId")) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + type = new ServicePrincipalType(property.Value.GetString()); + continue; + } + } + return new ServicePrincipal(principalId.Value, clientId.Value, tenantId.Value, Optional.ToNullable(type)); + } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipal.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipal.cs new file mode 100644 index 000000000000..b6aa1ff53a7f --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipal.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Sql.Models +{ + /// The managed instance's service principal configuration for a resource. + public partial class ServicePrincipal + { + /// Initializes a new instance of ServicePrincipal. + public ServicePrincipal() + { + } + + /// Initializes a new instance of ServicePrincipal. + /// The Azure Active Directory application object id. + /// The Azure Active Directory application client id. + /// The Azure Active Directory tenant id. + /// Service principal type. + internal ServicePrincipal(string principalId, string clientId, string tenantId, ServicePrincipalType? type) + { + PrincipalId = principalId; + ClientId = clientId; + TenantId = tenantId; + Type = type; + } + + /// The Azure Active Directory application object id. + public string PrincipalId { get; } + /// The Azure Active Directory application client id. + public string ClientId { get; } + /// The Azure Active Directory tenant id. + public string TenantId { get; } + /// Service principal type. + public ServicePrincipalType? Type { get; set; } + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipalType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipalType.cs new file mode 100644 index 000000000000..e1ddae478065 --- /dev/null +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/ServicePrincipalType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Sql.Models +{ + /// Service principal type. + public readonly partial struct ServicePrincipalType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServicePrincipalType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + + /// None. + public static ServicePrincipalType None { get; } = new ServicePrincipalType(NoneValue); + /// SystemAssigned. + public static ServicePrincipalType SystemAssigned { get; } = new ServicePrincipalType(SystemAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ServicePrincipalType left, ServicePrincipalType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServicePrincipalType left, ServicePrincipalType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServicePrincipalType(string value) => new ServicePrincipalType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServicePrincipalType other && Equals(other); + /// + public bool Equals(ServicePrincipalType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs index b163e683c0cf..a10641e781be 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseData.Serialization.cs @@ -24,6 +24,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("sku"); writer.WriteObjectValue(Sku); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } writer.WritePropertyName("tags"); writer.WriteStartObject(); foreach (var item in Tags) @@ -151,6 +156,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("isLedgerOn"); writer.WriteBooleanValue(IsLedgerOn.Value); } + if (Optional.IsDefined(FederatedClientId)) + { + writer.WritePropertyName("federatedClientId"); + writer.WriteStringValue(FederatedClientId.Value); + } + if (Optional.IsDefined(PrimaryDelegatedIdentityClientId)) + { + writer.WritePropertyName("primaryDelegatedIdentityClientId"); + writer.WriteStringValue(PrimaryDelegatedIdentityClientId.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -160,6 +175,7 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) Optional sku = default; Optional kind = default; Optional managedBy = default; + Optional identity = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -195,14 +211,16 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) Optional secondaryType = default; Optional currentSku = default; Optional autoPauseDelay = default; - Optional currentBackupStorageRedundancy = default; - Optional requestedBackupStorageRedundancy = default; + Optional currentBackupStorageRedundancy = default; + Optional requestedBackupStorageRedundancy = default; Optional minCapacity = default; Optional pausedDate = default; Optional resumedDate = default; Optional maintenanceConfigurationId = default; Optional isLedgerOn = default; Optional isInfraEncryptionEnabled = default; + Optional federatedClientId = default; + Optional primaryDelegatedIdentityClientId = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) @@ -225,6 +243,16 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) managedBy = property.Value.GetString(); continue; } + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = DatabaseIdentity.DeserializeDatabaseIdentity(property.Value); + continue; + } if (property.NameEquals("tags")) { Dictionary dictionary = new Dictionary(); @@ -511,7 +539,7 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) property0.ThrowNonNullablePropertyIsNull(); continue; } - currentBackupStorageRedundancy = new CurrentBackupStorageRedundancy(property0.Value.GetString()); + currentBackupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); continue; } if (property0.NameEquals("requestedBackupStorageRedundancy")) @@ -521,7 +549,7 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) property0.ThrowNonNullablePropertyIsNull(); continue; } - requestedBackupStorageRedundancy = new RequestedBackupStorageRedundancy(property0.Value.GetString()); + requestedBackupStorageRedundancy = new BackupStorageRedundancy(property0.Value.GetString()); continue; } if (property0.NameEquals("minCapacity")) @@ -579,11 +607,31 @@ internal static SqlDatabaseData DeserializeSqlDatabaseData(JsonElement element) isInfraEncryptionEnabled = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("federatedClientId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + federatedClientId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("primaryDelegatedIdentityClientId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + primaryDelegatedIdentityClientId = property0.Value.GetGuid(); + continue; + } } continue; } } - return new SqlDatabaseData(id, name, type, systemData, tags, location, sku.Value, kind.Value, managedBy.Value, Optional.ToNullable(createMode), collation.Value, Optional.ToNullable(maxSizeBytes), Optional.ToNullable(sampleName), elasticPoolId.Value, sourceDatabaseId.Value, Optional.ToNullable(status), Optional.ToNullable(databaseId), Optional.ToNullable(creationDate), currentServiceObjectiveName.Value, requestedServiceObjectiveName.Value, defaultSecondaryLocation.Value, failoverGroupId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(sourceDatabaseDeletionDate), recoveryServicesRecoveryPointId.Value, longTermRetentionBackupResourceId.Value, recoverableDatabaseId.Value, restorableDroppedDatabaseId.Value, Optional.ToNullable(catalogCollation), Optional.ToNullable(zoneRedundant), Optional.ToNullable(licenseType), Optional.ToNullable(maxLogSizeBytes), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(readScale), Optional.ToNullable(highAvailabilityReplicaCount), Optional.ToNullable(secondaryType), currentSku.Value, Optional.ToNullable(autoPauseDelay), Optional.ToNullable(currentBackupStorageRedundancy), Optional.ToNullable(requestedBackupStorageRedundancy), Optional.ToNullable(minCapacity), Optional.ToNullable(pausedDate), Optional.ToNullable(resumedDate), maintenanceConfigurationId.Value, Optional.ToNullable(isLedgerOn), Optional.ToNullable(isInfraEncryptionEnabled)); + return new SqlDatabaseData(id, name, type, systemData, tags, location, sku.Value, kind.Value, managedBy.Value, identity.Value, Optional.ToNullable(createMode), collation.Value, Optional.ToNullable(maxSizeBytes), Optional.ToNullable(sampleName), elasticPoolId.Value, sourceDatabaseId.Value, Optional.ToNullable(status), Optional.ToNullable(databaseId), Optional.ToNullable(creationDate), currentServiceObjectiveName.Value, requestedServiceObjectiveName.Value, defaultSecondaryLocation.Value, failoverGroupId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(sourceDatabaseDeletionDate), recoveryServicesRecoveryPointId.Value, longTermRetentionBackupResourceId.Value, recoverableDatabaseId.Value, restorableDroppedDatabaseId.Value, Optional.ToNullable(catalogCollation), Optional.ToNullable(zoneRedundant), Optional.ToNullable(licenseType), Optional.ToNullable(maxLogSizeBytes), Optional.ToNullable(earliestRestoreDate), Optional.ToNullable(readScale), Optional.ToNullable(highAvailabilityReplicaCount), Optional.ToNullable(secondaryType), currentSku.Value, Optional.ToNullable(autoPauseDelay), Optional.ToNullable(currentBackupStorageRedundancy), Optional.ToNullable(requestedBackupStorageRedundancy), Optional.ToNullable(minCapacity), Optional.ToNullable(pausedDate), Optional.ToNullable(resumedDate), maintenanceConfigurationId.Value, Optional.ToNullable(isLedgerOn), Optional.ToNullable(isInfraEncryptionEnabled), Optional.ToNullable(federatedClientId), Optional.ToNullable(primaryDelegatedIdentityClientId)); } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.Serialization.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.Serialization.cs index fa159233f545..f69c317ccbc1 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.Serialization.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.Serialization.cs @@ -20,6 +20,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("sku"); writer.WriteObjectValue(Sku); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + writer.WriteObjectValue(Identity); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"); @@ -148,6 +153,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("isLedgerOn"); writer.WriteBooleanValue(IsLedgerOn.Value); } + if (Optional.IsDefined(FederatedClientId)) + { + writer.WritePropertyName("federatedClientId"); + writer.WriteStringValue(FederatedClientId.Value); + } + if (Optional.IsDefined(PrimaryDelegatedIdentityClientId)) + { + writer.WritePropertyName("primaryDelegatedIdentityClientId"); + writer.WriteStringValue(PrimaryDelegatedIdentityClientId.Value); + } writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.cs index 51429dd1a6c2..576d9468c62d 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/SqlDatabaseUpdateOptions.cs @@ -22,6 +22,8 @@ public SqlDatabaseUpdateOptions() /// The name and tier of the SKU. public Sku Sku { get; set; } + /// Database identity. + public DatabaseIdentity Identity { get; set; } /// Resource tags. public IDictionary Tags { get; } /// @@ -101,9 +103,9 @@ public SqlDatabaseUpdateOptions() /// Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. public int? AutoPauseDelay { get; set; } /// The storage account type used to store backups for this database. - public CurrentBackupStorageRedundancy? CurrentBackupStorageRedundancy { get; } + public BackupStorageRedundancy? CurrentBackupStorageRedundancy { get; } /// The storage account type to be used to store backups for this database. - public RequestedBackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } + public BackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } /// Minimal capacity that database will always have allocated, if not paused. public double? MinCapacity { get; set; } /// The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. @@ -116,5 +118,9 @@ public SqlDatabaseUpdateOptions() public bool? IsLedgerOn { get; set; } /// Infra encryption is enabled for this database. public bool? IsInfraEncryptionEnabled { get; } + /// The Client id used for cross tenant per database CMK scenario. + public Guid? FederatedClientId { get; set; } + /// The Primary Delegated Identity Client id used for per database CMK - for internal use only. + public Guid? PrimaryDelegatedIdentityClientId { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/StorageAccountType.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/StorageAccountType.cs deleted file mode 100644 index 3228d0238f9f..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/StorageAccountType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The storage account type used to store backups for this instance. The options are LRS (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). - public readonly partial struct StorageAccountType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public StorageAccountType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string GRSValue = "GRS"; - private const string LRSValue = "LRS"; - private const string ZRSValue = "ZRS"; - - /// GRS. - public static StorageAccountType GRS { get; } = new StorageAccountType(GRSValue); - /// LRS. - public static StorageAccountType LRS { get; } = new StorageAccountType(LRSValue); - /// ZRS. - public static StorageAccountType ZRS { get; } = new StorageAccountType(ZRSValue); - /// Determines if two values are the same. - public static bool operator ==(StorageAccountType left, StorageAccountType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(StorageAccountType left, StorageAccountType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator StorageAccountType(string value) => new StorageAccountType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is StorageAccountType other && Equals(other); - /// - public bool Equals(StorageAccountType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/TargetBackupStorageRedundancy.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/TargetBackupStorageRedundancy.cs deleted file mode 100644 index 6dd57e682089..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/TargetBackupStorageRedundancy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Sql.Models -{ - /// The storage redundancy type of the copied backup. - public readonly partial struct TargetBackupStorageRedundancy : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TargetBackupStorageRedundancy(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string GeoValue = "Geo"; - private const string LocalValue = "Local"; - private const string ZoneValue = "Zone"; - - /// Geo. - public static TargetBackupStorageRedundancy Geo { get; } = new TargetBackupStorageRedundancy(GeoValue); - /// Local. - public static TargetBackupStorageRedundancy Local { get; } = new TargetBackupStorageRedundancy(LocalValue); - /// Zone. - public static TargetBackupStorageRedundancy Zone { get; } = new TargetBackupStorageRedundancy(ZoneValue); - /// Determines if two values are the same. - public static bool operator ==(TargetBackupStorageRedundancy left, TargetBackupStorageRedundancy right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TargetBackupStorageRedundancy left, TargetBackupStorageRedundancy right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TargetBackupStorageRedundancy(string value) => new TargetBackupStorageRedundancy(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TargetBackupStorageRedundancy other && Equals(other); - /// - public bool Equals(TargetBackupStorageRedundancy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/UpdateLongTermRetentionBackupOptions.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/UpdateLongTermRetentionBackupOptions.cs index 6acad900ebfe..06593a8d5093 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/UpdateLongTermRetentionBackupOptions.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/Models/UpdateLongTermRetentionBackupOptions.cs @@ -16,6 +16,6 @@ public UpdateLongTermRetentionBackupOptions() } /// The storage redundancy type of the copied backup. - public RequestedBackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } + public BackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionBackupsRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionBackupsRestOperations.cs index 5d96112e4603..8a65070027bc 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionBackupsRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionBackupsRestOperations.cs @@ -37,7 +37,7 @@ internal partial class LongTermRetentionBackupsRestOperations public LongTermRetentionBackupsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-11-01-preview"; + _apiVersion = apiVersion ?? "2021-05-01-preview"; ClientDiagnostics = clientDiagnostics; _pipeline = pipeline; _userAgent = Core.HttpMessageUtilities.GetUserAgentName(this, applicationId); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionManagedInstanceBackupsRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionManagedInstanceBackupsRestOperations.cs index cfddda8607b6..fc6b2b93cf30 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionManagedInstanceBackupsRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/LongTermRetentionManagedInstanceBackupsRestOperations.cs @@ -37,7 +37,7 @@ internal partial class LongTermRetentionManagedInstanceBackupsRestOperations public LongTermRetentionManagedInstanceBackupsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-11-01-preview"; + _apiVersion = apiVersion ?? "2021-05-01-preview"; ClientDiagnostics = clientDiagnostics; _pipeline = pipeline; _userAgent = Core.HttpMessageUtilities.GetUserAgentName(this, applicationId); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs index c7a171ec6f47..f8f81bad7fe8 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/ManagedInstancesRestOperations.cs @@ -37,7 +37,7 @@ internal partial class ManagedInstancesRestOperations public ManagedInstancesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-11-01-preview"; + _apiVersion = apiVersion ?? "2021-05-01-preview"; ClientDiagnostics = clientDiagnostics; _pipeline = pipeline; _userAgent = Core.HttpMessageUtilities.GetUserAgentName(this, applicationId); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/OperationsHealthRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/OperationsHealthRestOperations.cs deleted file mode 100644 index c19f83fd1f31..000000000000 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/OperationsHealthRestOperations.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Core; -using Azure.ResourceManager.Sql.Models; - -namespace Azure.ResourceManager.Sql -{ - internal partial class OperationsHealthRestOperations - { - private readonly string _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// The ClientDiagnostics is used to provide tracing support for the client library. - internal ClientDiagnostics ClientDiagnostics { get; } - - /// Initializes a new instance of OperationsHealthRestOperations. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// is null. - public OperationsHealthRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-11-01-preview"; - ClientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - _userAgent = Core.HttpMessageUtilities.GetUserAgentName(this, applicationId); - } - - internal HttpMessage CreateListByLocationRequest(string subscriptionId, string locationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Sql/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/operationsHealth", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - message.SetProperty("SDKUserAgent", _userAgent); - return message; - } - - /// Gets a service operation health status. - /// The subscription ID that identifies an Azure subscription. - /// The name of the region where the resource is located. - /// The cancellation token to use. - /// or is null. - public async Task> ListByLocationAsync(string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - if (locationName == null) - { - throw new ArgumentNullException(nameof(locationName)); - } - - using var message = CreateListByLocationRequest(subscriptionId, locationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OperationsHealthListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OperationsHealthListResult.DeserializeOperationsHealthListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await ClientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Gets a service operation health status. - /// The subscription ID that identifies an Azure subscription. - /// The name of the region where the resource is located. - /// The cancellation token to use. - /// or is null. - public Response ListByLocation(string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - if (locationName == null) - { - throw new ArgumentNullException(nameof(locationName)); - } - - using var message = CreateListByLocationRequest(subscriptionId, locationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OperationsHealthListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OperationsHealthListResult.DeserializeOperationsHealthListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw ClientDiagnostics.CreateRequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, string locationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - message.SetProperty("SDKUserAgent", _userAgent); - return message; - } - - /// Gets a service operation health status. - /// The URL to the next page of results. - /// The subscription ID that identifies an Azure subscription. - /// The name of the region where the resource is located. - /// The cancellation token to use. - /// , or is null. - public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - if (locationName == null) - { - throw new ArgumentNullException(nameof(locationName)); - } - - using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, locationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OperationsHealthListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OperationsHealthListResult.DeserializeOperationsHealthListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await ClientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Gets a service operation health status. - /// The URL to the next page of results. - /// The subscription ID that identifies an Azure subscription. - /// The name of the region where the resource is located. - /// The cancellation token to use. - /// , or is null. - public Response ListByLocationNextPage(string nextLink, string subscriptionId, string locationName, CancellationToken cancellationToken = default) - { - if (nextLink == null) - { - throw new ArgumentNullException(nameof(nextLink)); - } - if (subscriptionId == null) - { - throw new ArgumentNullException(nameof(subscriptionId)); - } - if (locationName == null) - { - throw new ArgumentNullException(nameof(locationName)); - } - - using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, locationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OperationsHealthListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OperationsHealthListResult.DeserializeOperationsHealthListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw ClientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedDatabasesRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedDatabasesRestOperations.cs index 3974d77c994a..84d165948653 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedDatabasesRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedDatabasesRestOperations.cs @@ -37,7 +37,7 @@ internal partial class RestorableDroppedDatabasesRestOperations public RestorableDroppedDatabasesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-02-01-preview"; + _apiVersion = apiVersion ?? "2021-05-01-preview"; ClientDiagnostics = clientDiagnostics; _pipeline = pipeline; _userAgent = Core.HttpMessageUtilities.GetUserAgentName(this, applicationId); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedManagedDatabasesRestOperations.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedManagedDatabasesRestOperations.cs index 9be49bd580ea..6e8a6874f886 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedManagedDatabasesRestOperations.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestOperations/RestorableDroppedManagedDatabasesRestOperations.cs @@ -37,7 +37,7 @@ internal partial class RestorableDroppedManagedDatabasesRestOperations public RestorableDroppedManagedDatabasesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-02-01-preview"; + _apiVersion = apiVersion ?? "2021-05-01-preview"; ClientDiagnostics = clientDiagnostics; _pipeline = pipeline; _userAgent = Core.HttpMessageUtilities.GetUserAgentName(this, applicationId); diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedDatabaseData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedDatabaseData.cs index 4206a72a8669..b777f6d0bd99 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedDatabaseData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/RestorableDroppedDatabaseData.cs @@ -32,19 +32,17 @@ public RestorableDroppedDatabaseData() /// Resource tags. /// The name of the database. /// The max size of the database expressed in bytes. - /// DEPRECATED: The resource name of the elastic pool containing this database. This property is deprecated and the value will always be null. /// The creation date of the database (ISO8601 format). /// The deletion date of the database (ISO8601 format). /// The earliest restore date of the database (ISO8601 format). /// The storage account type used to store backups for this database. - internal RestorableDroppedDatabaseData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, Models.Sku sku, string location, IDictionary tags, string databaseName, long? maxSizeBytes, string elasticPoolId, DateTimeOffset? creationDate, DateTimeOffset? deletionDate, DateTimeOffset? earliestRestoreDate, RestorableDroppedDatabasePropertiesBackupStorageRedundancy? backupStorageRedundancy) : base(id, name, type, systemData) + internal RestorableDroppedDatabaseData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, Models.Sku sku, string location, IDictionary tags, string databaseName, long? maxSizeBytes, DateTimeOffset? creationDate, DateTimeOffset? deletionDate, DateTimeOffset? earliestRestoreDate, BackupStorageRedundancy? backupStorageRedundancy) : base(id, name, type, systemData) { Sku = sku; Location = location; Tags = tags; DatabaseName = databaseName; MaxSizeBytes = maxSizeBytes; - ElasticPoolId = elasticPoolId; CreationDate = creationDate; DeletionDate = deletionDate; EarliestRestoreDate = earliestRestoreDate; @@ -61,8 +59,6 @@ internal RestorableDroppedDatabaseData(ResourceIdentifier id, string name, Resou public string DatabaseName { get; } /// The max size of the database expressed in bytes. public long? MaxSizeBytes { get; } - /// DEPRECATED: The resource name of the elastic pool containing this database. This property is deprecated and the value will always be null. - public string ElasticPoolId { get; } /// The creation date of the database (ISO8601 format). public DateTimeOffset? CreationDate { get; } /// The deletion date of the database (ISO8601 format). @@ -70,6 +66,6 @@ internal RestorableDroppedDatabaseData(ResourceIdentifier id, string name, Resou /// The earliest restore date of the database (ISO8601 format). public DateTimeOffset? EarliestRestoreDate { get; } /// The storage account type used to store backups for this database. - public RestorableDroppedDatabasePropertiesBackupStorageRedundancy? BackupStorageRedundancy { get; } + public BackupStorageRedundancy? BackupStorageRedundancy { get; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs index 5f61ea9c41c4..e3137a8e5b8b 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Generated/SqlDatabaseData.cs @@ -45,6 +45,7 @@ public SqlDatabaseData(AzureLocation location) : base(location) /// /// Kind of database. This is metadata used for the Azure portal experience. /// Resource that manages the database. + /// The Azure Active Directory identity of the database. /// /// Specifies the mode of database creation. /// @@ -100,11 +101,14 @@ public SqlDatabaseData(AzureLocation location) : base(location) /// Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur. /// Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. /// Infra encryption is enabled for this database. - internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary tags, AzureLocation location, Models.Sku sku, string kind, string managedBy, CreateMode? createMode, string collation, long? maxSizeBytes, SampleSchemaName? sampleName, string elasticPoolId, string sourceDatabaseId, DatabaseStatus? status, Guid? databaseId, DateTimeOffset? creationDate, string currentServiceObjectiveName, string requestedServiceObjectiveName, string defaultSecondaryLocation, string failoverGroupId, DateTimeOffset? restorePointInTime, DateTimeOffset? sourceDatabaseDeletionDate, string recoveryServicesRecoveryPointId, string longTermRetentionBackupResourceId, string recoverableDatabaseId, string restorableDroppedDatabaseId, CatalogCollationType? catalogCollation, bool? zoneRedundant, DatabaseLicenseType? licenseType, long? maxLogSizeBytes, DateTimeOffset? earliestRestoreDate, DatabaseReadScale? readScale, int? highAvailabilityReplicaCount, SecondaryType? secondaryType, Models.Sku currentSku, int? autoPauseDelay, CurrentBackupStorageRedundancy? currentBackupStorageRedundancy, RequestedBackupStorageRedundancy? requestedBackupStorageRedundancy, double? minCapacity, DateTimeOffset? pausedDate, DateTimeOffset? resumedDate, string maintenanceConfigurationId, bool? isLedgerOn, bool? isInfraEncryptionEnabled) : base(id, name, type, systemData, tags, location) + /// The Client id used for cross tenant per database CMK scenario. + /// The Primary Delegated Identity Client id used for per database CMK - for internal use only. + internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary tags, AzureLocation location, Models.Sku sku, string kind, string managedBy, DatabaseIdentity identity, CreateMode? createMode, string collation, long? maxSizeBytes, SampleSchemaName? sampleName, string elasticPoolId, string sourceDatabaseId, DatabaseStatus? status, Guid? databaseId, DateTimeOffset? creationDate, string currentServiceObjectiveName, string requestedServiceObjectiveName, string defaultSecondaryLocation, string failoverGroupId, DateTimeOffset? restorePointInTime, DateTimeOffset? sourceDatabaseDeletionDate, string recoveryServicesRecoveryPointId, string longTermRetentionBackupResourceId, string recoverableDatabaseId, string restorableDroppedDatabaseId, CatalogCollationType? catalogCollation, bool? zoneRedundant, DatabaseLicenseType? licenseType, long? maxLogSizeBytes, DateTimeOffset? earliestRestoreDate, DatabaseReadScale? readScale, int? highAvailabilityReplicaCount, SecondaryType? secondaryType, Models.Sku currentSku, int? autoPauseDelay, BackupStorageRedundancy? currentBackupStorageRedundancy, BackupStorageRedundancy? requestedBackupStorageRedundancy, double? minCapacity, DateTimeOffset? pausedDate, DateTimeOffset? resumedDate, string maintenanceConfigurationId, bool? isLedgerOn, bool? isInfraEncryptionEnabled, Guid? federatedClientId, Guid? primaryDelegatedIdentityClientId) : base(id, name, type, systemData, tags, location) { Sku = sku; Kind = kind; ManagedBy = managedBy; + Identity = identity; CreateMode = createMode; Collation = collation; MaxSizeBytes = maxSizeBytes; @@ -142,6 +146,8 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType type, MaintenanceConfigurationId = maintenanceConfigurationId; IsLedgerOn = isLedgerOn; IsInfraEncryptionEnabled = isInfraEncryptionEnabled; + FederatedClientId = federatedClientId; + PrimaryDelegatedIdentityClientId = primaryDelegatedIdentityClientId; } /// @@ -163,6 +169,8 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType type, public string Kind { get; } /// Resource that manages the database. public string ManagedBy { get; } + /// The Azure Active Directory identity of the database. + public DatabaseIdentity Identity { get; set; } /// /// Specifies the mode of database creation. /// @@ -240,9 +248,9 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType type, /// Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. public int? AutoPauseDelay { get; set; } /// The storage account type used to store backups for this database. - public CurrentBackupStorageRedundancy? CurrentBackupStorageRedundancy { get; } + public BackupStorageRedundancy? CurrentBackupStorageRedundancy { get; } /// The storage account type to be used to store backups for this database. - public RequestedBackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } + public BackupStorageRedundancy? RequestedBackupStorageRedundancy { get; set; } /// Minimal capacity that database will always have allocated, if not paused. public double? MinCapacity { get; set; } /// The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready. @@ -255,5 +263,9 @@ internal SqlDatabaseData(ResourceIdentifier id, string name, ResourceType type, public bool? IsLedgerOn { get; set; } /// Infra encryption is enabled for this database. public bool? IsInfraEncryptionEnabled { get; } + /// The Client id used for cross tenant per database CMK scenario. + public Guid? FederatedClientId { get; set; } + /// The Primary Delegated Identity Client id used for per database CMK - for internal use only. + public Guid? PrimaryDelegatedIdentityClientId { get; set; } } } diff --git a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md index 162d15f4fdbb..41f2b59eefa9 100644 --- a/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md +++ b/sdk/sqlmanagement/Azure.ResourceManager.Sql/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml azure-arm: true -require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/4946dbb5b2893a77ce52d08e2a855056e1acd361/specification/sql/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/c139902244397a84e87323eccb1554de88c90157/specification/sql/resource-manager/readme.md namespace: Azure.ResourceManager.Sql output-folder: $(this-folder)/Generated model-namespace: false