public PSTransparentDataEncryption(TransparentDataEncryption encryption, string resourceGroupName, string workspaceName, string sqlPoolName) { this.ResourceGroupName = resourceGroupName; this.WorkspaceName = workspaceName; this.SqlPoolName = sqlPoolName; TransparentDataEncryptionStateType state = TransparentDataEncryptionStateType.Disabled; Enum.TryParse <TransparentDataEncryptionStateType>(encryption.Status?.ToString(), true, out state); this.State = state; }
/// <summary> /// Convert a Management.Sql.Models.TransparentDataEncryption to AzureSqlDatabaseTransparentDataEncryptionModel /// </summary> /// <param name="resourceGroup">The resource group the server is in</param> /// <param name="serverName">The name of the server</param> /// <param name="resp">The management client server response to convert</param> /// <returns>The converted server model</returns> private static AzureSqlDatabaseTransparentDataEncryptionModel CreateTransparentDataEncryptionModelFromResponse(string resourceGroup, string serverName, string databaseName, Management.Sql.Models.TransparentDataEncryption resp) { AzureSqlDatabaseTransparentDataEncryptionModel TransparentDataEncryption = new AzureSqlDatabaseTransparentDataEncryptionModel(); TransparentDataEncryption.ResourceGroupName = resourceGroup; TransparentDataEncryption.ServerName = serverName; TransparentDataEncryption.DatabaseName = databaseName; TransparentDataEncryptionStateType State = TransparentDataEncryptionStateType.Disabled; Enum.TryParse <TransparentDataEncryptionStateType>(resp.Properties.State, true, out State); TransparentDataEncryption.State = State; return(TransparentDataEncryption); }