Beispiel #1
0
        internal static string ToSerializedValue(this TransparentDataEncryptionState value)
        {
            switch (value)
            {
            case TransparentDataEncryptionState.Enabled:
                return("Enabled");

            case TransparentDataEncryptionState.Disabled:
                return("Disabled");
            }
            return(null);
        }
        /// <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)
        {
            TransparentDataEncryptionState state = TransparentDataEncryptionState.Enabled;

            if (model.State.ToString().Equals(TransparentDataEncryptionState.Disabled.ToString()))
            {
                state = TransparentDataEncryptionState.Disabled;
            }

            var resp = Communicator.CreateOrUpdate(model.ResourceGroupName, model.ServerName, model.DatabaseName, new Management.Sql.Models.LogicalDatabaseTransparentDataEncryption()
            {
                State = state
            });

            return(CreateTransparentDataEncryptionModelFromResponse(model.ResourceGroupName, model.ServerName, model.DatabaseName, resp));
        }
 /// <summary>
 /// Initializes a new instance of the ManagedTransparentDataEncryption
 /// class.
 /// </summary>
 /// <param name="state">Specifies the state of the transparent data
 /// encryption. Possible values include: 'Enabled', 'Disabled'</param>
 /// <param name="id">Resource ID.</param>
 /// <param name="name">Resource name.</param>
 /// <param name="type">Resource type.</param>
 public ManagedTransparentDataEncryption(TransparentDataEncryptionState state, string id = default(string), string name = default(string), string type = default(string))
     : base(id, name, type)
 {
     State = state;
     CustomInit();
 }
Beispiel #4
0
 public static string ToSerialString(this TransparentDataEncryptionState value) => value switch
 {