// https://www.terraform.io/docs/providers/aws/r/memorydb_user
// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function memorydbUserAuthenticationModeToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        passwords: cdktf.listMapper(cdktf.stringToTerraform)(struct.passwords),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export class MemorydbUserAuthenticationModeOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._passwords !== undefined) {
            hasAnyValues = true;
            internalValueResult.passwords = this._passwords;
        }
        if (this._type !== undefined) {
            hasAnyValues = true;
            internalValueResult.type = this._type;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._passwords = undefined;
            this._type = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._passwords = value.passwords;
            this._type = value.type;
        }
    }
    // password_count - computed: true, optional: false, required: false
    get passwordCount() {
        return this.getNumberAttribute('password_count');
    }
    // passwords - computed: false, optional: false, required: true
    _passwords;
    get passwords() {
        return cdktf.Fn.tolist(this.getListAttribute('passwords'));
    }
    set passwords(value) {
        this._passwords = value;
    }
    // Temporarily expose input value. Use with caution.
    get passwordsInput() {
        return this._passwords;
    }
    // type - computed: false, optional: false, required: true
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/memorydb_user aws_memorydb_user}
*/
export class MemorydbUser extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_memorydb_user";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/memorydb_user aws_memorydb_user} Resource
    *
    * @param scope The scope in which to define this construct
    * @param id The scoped construct ID. Must be unique amongst siblings in the same scope
    * @param options MemorydbUserConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_memorydb_user',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._accessString = config.accessString;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._userName = config.userName;
        this._authenticationMode.internalValue = config.authenticationMode;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // access_string - computed: false, optional: false, required: true
    _accessString;
    get accessString() {
        return this.getStringAttribute('access_string');
    }
    set accessString(value) {
        this._accessString = value;
    }
    // Temporarily expose input value. Use with caution.
    get accessStringInput() {
        return this._accessString;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // minimum_engine_version - computed: true, optional: false, required: false
    get minimumEngineVersion() {
        return this.getStringAttribute('minimum_engine_version');
    }
    // tags - computed: false, optional: true, required: false
    _tags;
    get tags() {
        return this.getStringMapAttribute('tags');
    }
    set tags(value) {
        this._tags = value;
    }
    resetTags() {
        this._tags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsInput() {
        return this._tags;
    }
    // tags_all - computed: true, optional: true, required: false
    _tagsAll;
    get tagsAll() {
        return this.getStringMapAttribute('tags_all');
    }
    set tagsAll(value) {
        this._tagsAll = value;
    }
    resetTagsAll() {
        this._tagsAll = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsAllInput() {
        return this._tagsAll;
    }
    // user_name - computed: false, optional: false, required: true
    _userName;
    get userName() {
        return this.getStringAttribute('user_name');
    }
    set userName(value) {
        this._userName = value;
    }
    // Temporarily expose input value. Use with caution.
    get userNameInput() {
        return this._userName;
    }
    // authentication_mode - computed: false, optional: false, required: true
    _authenticationMode = new MemorydbUserAuthenticationModeOutputReference(this, "authentication_mode", true);
    get authenticationMode() {
        return this._authenticationMode;
    }
    putAuthenticationMode(value) {
        this._authenticationMode.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get authenticationModeInput() {
        return this._authenticationMode.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            access_string: cdktf.stringToTerraform(this._accessString),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            user_name: cdktf.stringToTerraform(this._userName),
            authentication_mode: memorydbUserAuthenticationModeToTerraform(this._authenticationMode.internalValue),
        };
    }
}
//# sourceMappingURL=memorydb-user.js.map