// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Tctest.Mysql
{
    [TctestResourceType("tctest:Mysql/accountPrivilege:AccountPrivilege")]
    public partial class AccountPrivilege : Pulumi.CustomResource
    {
        /// <summary>
        /// Account host, default is `%`.
        /// </summary>
        [Output("accountHost")]
        public Output<string?> AccountHost { get; private set; } = null!;

        /// <summary>
        /// Account name.
        /// </summary>
        [Output("accountName")]
        public Output<string> AccountName { get; private set; } = null!;

        /// <summary>
        /// List of specified database name.
        /// </summary>
        [Output("databaseNames")]
        public Output<ImmutableArray<string>> DatabaseNames { get; private set; } = null!;

        /// <summary>
        /// Instance ID.
        /// </summary>
        [Output("mysqlId")]
        public Output<string> MysqlId { get; private set; } = null!;

        /// <summary>
        /// Database permissions. Valid values: `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `DROP`, `REFERENCES`, `INDEX`,
        /// `ALTER`, `CREATE TEMPORARY TABLES`, `LOCK TABLES`, `EXECUTE`, `CREATE VIEW`, `SHOW VIEW`, `CREATE ROUTINE`, `ALTER
        /// ROUTINE`, `EVENT` and `TRIGGER``.
        /// </summary>
        [Output("privileges")]
        public Output<ImmutableArray<string>> Privileges { get; private set; } = null!;


        /// <summary>
        /// Create a AccountPrivilege resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public AccountPrivilege(string name, AccountPrivilegeArgs args, CustomResourceOptions? options = null)
            : base("tctest:Mysql/accountPrivilege:AccountPrivilege", name, args ?? new AccountPrivilegeArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AccountPrivilege(string name, Input<string> id, AccountPrivilegeState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Mysql/accountPrivilege:AccountPrivilege", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing AccountPrivilege resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static AccountPrivilege Get(string name, Input<string> id, AccountPrivilegeState? state = null, CustomResourceOptions? options = null)
        {
            return new AccountPrivilege(name, id, state, options);
        }
    }

    public sealed class AccountPrivilegeArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Account host, default is `%`.
        /// </summary>
        [Input("accountHost")]
        public Input<string>? AccountHost { get; set; }

        /// <summary>
        /// Account name.
        /// </summary>
        [Input("accountName", required: true)]
        public Input<string> AccountName { get; set; } = null!;

        [Input("databaseNames", required: true)]
        private InputList<string>? _databaseNames;

        /// <summary>
        /// List of specified database name.
        /// </summary>
        public InputList<string> DatabaseNames
        {
            get => _databaseNames ?? (_databaseNames = new InputList<string>());
            set => _databaseNames = value;
        }

        /// <summary>
        /// Instance ID.
        /// </summary>
        [Input("mysqlId", required: true)]
        public Input<string> MysqlId { get; set; } = null!;

        [Input("privileges")]
        private InputList<string>? _privileges;

        /// <summary>
        /// Database permissions. Valid values: `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `DROP`, `REFERENCES`, `INDEX`,
        /// `ALTER`, `CREATE TEMPORARY TABLES`, `LOCK TABLES`, `EXECUTE`, `CREATE VIEW`, `SHOW VIEW`, `CREATE ROUTINE`, `ALTER
        /// ROUTINE`, `EVENT` and `TRIGGER``.
        /// </summary>
        public InputList<string> Privileges
        {
            get => _privileges ?? (_privileges = new InputList<string>());
            set => _privileges = value;
        }

        public AccountPrivilegeArgs()
        {
        }
    }

    public sealed class AccountPrivilegeState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Account host, default is `%`.
        /// </summary>
        [Input("accountHost")]
        public Input<string>? AccountHost { get; set; }

        /// <summary>
        /// Account name.
        /// </summary>
        [Input("accountName")]
        public Input<string>? AccountName { get; set; }

        [Input("databaseNames")]
        private InputList<string>? _databaseNames;

        /// <summary>
        /// List of specified database name.
        /// </summary>
        public InputList<string> DatabaseNames
        {
            get => _databaseNames ?? (_databaseNames = new InputList<string>());
            set => _databaseNames = value;
        }

        /// <summary>
        /// Instance ID.
        /// </summary>
        [Input("mysqlId")]
        public Input<string>? MysqlId { get; set; }

        [Input("privileges")]
        private InputList<string>? _privileges;

        /// <summary>
        /// Database permissions. Valid values: `SELECT`, `INSERT`, `UPDATE`, `DELETE`, `CREATE`, `DROP`, `REFERENCES`, `INDEX`,
        /// `ALTER`, `CREATE TEMPORARY TABLES`, `LOCK TABLES`, `EXECUTE`, `CREATE VIEW`, `SHOW VIEW`, `CREATE ROUTINE`, `ALTER
        /// ROUTINE`, `EVENT` and `TRIGGER``.
        /// </summary>
        public InputList<string> Privileges
        {
            get => _privileges ?? (_privileges = new InputList<string>());
            set => _privileges = value;
        }

        public AccountPrivilegeState()
        {
        }
    }
}
