// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function appstreamDirectoryConfigServiceAccountCredentialsToTerraform(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 {
        account_name: cdktf.stringToTerraform(struct.accountName),
        account_password: cdktf.stringToTerraform(struct.accountPassword),
    };
}
export class AppstreamDirectoryConfigServiceAccountCredentialsOutputReference 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._accountName !== undefined) {
            hasAnyValues = true;
            internalValueResult.accountName = this._accountName;
        }
        if (this._accountPassword !== undefined) {
            hasAnyValues = true;
            internalValueResult.accountPassword = this._accountPassword;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._accountName = undefined;
            this._accountPassword = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._accountName = value.accountName;
            this._accountPassword = value.accountPassword;
        }
    }
    // account_name - computed: false, optional: false, required: true
    _accountName;
    get accountName() {
        return this.getStringAttribute('account_name');
    }
    set accountName(value) {
        this._accountName = value;
    }
    // Temporarily expose input value. Use with caution.
    get accountNameInput() {
        return this._accountName;
    }
    // account_password - computed: false, optional: false, required: true
    _accountPassword;
    get accountPassword() {
        return this.getStringAttribute('account_password');
    }
    set accountPassword(value) {
        this._accountPassword = value;
    }
    // Temporarily expose input value. Use with caution.
    get accountPasswordInput() {
        return this._accountPassword;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config aws_appstream_directory_config}
*/
export class AppstreamDirectoryConfig extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_appstream_directory_config";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/appstream_directory_config aws_appstream_directory_config} 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 AppstreamDirectoryConfigConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_appstream_directory_config',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._directoryName = config.directoryName;
        this._organizationalUnitDistinguishedNames = config.organizationalUnitDistinguishedNames;
        this._serviceAccountCredentials.internalValue = config.serviceAccountCredentials;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // created_time - computed: true, optional: false, required: false
    get createdTime() {
        return this.getStringAttribute('created_time');
    }
    // directory_name - computed: false, optional: false, required: true
    _directoryName;
    get directoryName() {
        return this.getStringAttribute('directory_name');
    }
    set directoryName(value) {
        this._directoryName = value;
    }
    // Temporarily expose input value. Use with caution.
    get directoryNameInput() {
        return this._directoryName;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // organizational_unit_distinguished_names - computed: false, optional: false, required: true
    _organizationalUnitDistinguishedNames;
    get organizationalUnitDistinguishedNames() {
        return cdktf.Fn.tolist(this.getListAttribute('organizational_unit_distinguished_names'));
    }
    set organizationalUnitDistinguishedNames(value) {
        this._organizationalUnitDistinguishedNames = value;
    }
    // Temporarily expose input value. Use with caution.
    get organizationalUnitDistinguishedNamesInput() {
        return this._organizationalUnitDistinguishedNames;
    }
    // service_account_credentials - computed: false, optional: false, required: true
    _serviceAccountCredentials = new AppstreamDirectoryConfigServiceAccountCredentialsOutputReference(this, "service_account_credentials", true);
    get serviceAccountCredentials() {
        return this._serviceAccountCredentials;
    }
    putServiceAccountCredentials(value) {
        this._serviceAccountCredentials.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get serviceAccountCredentialsInput() {
        return this._serviceAccountCredentials.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            directory_name: cdktf.stringToTerraform(this._directoryName),
            organizational_unit_distinguished_names: cdktf.listMapper(cdktf.stringToTerraform)(this._organizationalUnitDistinguishedNames),
            service_account_credentials: appstreamDirectoryConfigServiceAccountCredentialsToTerraform(this._serviceAccountCredentials.internalValue),
        };
    }
}
//# sourceMappingURL=appstream-directory-config.js.map