Esempio n. 1
0
        internal static string ToSerializedValue(this TransparentDataEncryptionStatus value)
        {
            switch (value)
            {
            case TransparentDataEncryptionStatus.Enabled:
                return("Enabled");

            case TransparentDataEncryptionStatus.Disabled:
                return("Disabled");
            }
            return(null);
        }
Esempio n. 2
0
        /// <summary>
        /// Upserts a Transparent Data Encryption
        /// </summary>
        /// <param name="resourceGroup">The name of the resource group</param>
        /// <param name="serverName">The name of ther server</param>
        /// <param name="model">The Transparent Data Encryption to create</param>
        /// <returns>The updated server model</returns>
        public AzureSqlDatabaseTransparentDataEncryptionModel UpsertTransparentDataEncryption(AzureSqlDatabaseTransparentDataEncryptionModel model)
        {
            TransparentDataEncryptionStatus status = TransparentDataEncryptionStatus.Enabled;

            if (model.State.ToString().Equals(TransparentDataEncryptionStatus.Disabled.ToString()))
            {
                status = TransparentDataEncryptionStatus.Disabled;
            }

            var resp = Communicator.CreateOrUpdate(model.ResourceGroupName, model.ServerName, model.DatabaseName, new Management.Sql.Models.TransparentDataEncryption()
            {
                Status = status
            });;

            return(CreateTransparentDataEncryptionModelFromResponse(model.ResourceGroupName, model.ServerName, model.DatabaseName, resp));
        }
Esempio n. 3
0
 /// <summary>
 /// Updates the state of the transparent data encryption status.
 /// </summary>
 /// <param name="transparentDataEncryptionState">State of the data encryption to set.</param>
 /// <return>The new encryption settings after the update operation.</return>
 Microsoft.Azure.Management.Sql.Fluent.ITransparentDataEncryption Microsoft.Azure.Management.Sql.Fluent.ITransparentDataEncryption.UpdateStatus(TransparentDataEncryptionStatus transparentDataEncryptionState)
 {
     return(this.UpdateStatus(transparentDataEncryptionState));
 }
Esempio n. 4
0
 /// <summary>
 /// Updates the state of the transparent data encryption status.
 /// </summary>
 /// <param name="transparentDataEncryptionState">State of the data encryption to set.</param>
 /// <return>A representation of the deferred computation of the new encryption settings after the update operation.</return>
 async Task <Microsoft.Azure.Management.Sql.Fluent.ITransparentDataEncryption> Microsoft.Azure.Management.Sql.Fluent.ITransparentDataEncryption.UpdateStatusAsync(TransparentDataEncryptionStatus transparentDataEncryptionState, CancellationToken cancellationToken)
 {
     return(await this.UpdateStatusAsync(transparentDataEncryptionState, cancellationToken));
 }
Esempio n. 5
0
 public static string ToSerialString(this TransparentDataEncryptionStatus value) => value switch
 {
        ///GENMHASH:BBAE2D48EA5C43449DBE61B80641DDF2:C760C066C2E0A08B68FCB68FC9D5E29F
        public async Task <Microsoft.Azure.Management.Sql.Fluent.ITransparentDataEncryption> UpdateStatusAsync(TransparentDataEncryptionStatus transparentDataEncryptionState, CancellationToken cancellationToken = default(CancellationToken))
        {
            this.SetInner(await this.sqlServerManager.Inner.TransparentDataEncryptions
                          .CreateOrUpdateAsync(this.ResourceGroupName(), this.SqlServerName(), this.DatabaseName(), transparentDataEncryptionState, cancellationToken));

            return(this);
        }
 ///GENMHASH:963770852AF9FA245B7756A9091BA5E1:B07801976DBB925452B1BA38235ED912
 public ITransparentDataEncryption UpdateStatus(TransparentDataEncryptionStatus transparentDataEncryptionStatus)
 {
     return(Extensions.Synchronize(() => this.UpdateStatusAsync(transparentDataEncryptionStatus)));
 }