// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function elasticsearchDomainSamlOptionsSamlOptionsIdpToTerraform(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 {
        entity_id: cdktf.stringToTerraform(struct.entityId),
        metadata_content: cdktf.stringToTerraform(struct.metadataContent),
    };
}
export class ElasticsearchDomainSamlOptionsSamlOptionsIdpOutputReference 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._entityId !== undefined) {
            hasAnyValues = true;
            internalValueResult.entityId = this._entityId;
        }
        if (this._metadataContent !== undefined) {
            hasAnyValues = true;
            internalValueResult.metadataContent = this._metadataContent;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._entityId = undefined;
            this._metadataContent = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._entityId = value.entityId;
            this._metadataContent = value.metadataContent;
        }
    }
    // entity_id - computed: false, optional: false, required: true
    _entityId;
    get entityId() {
        return this.getStringAttribute('entity_id');
    }
    set entityId(value) {
        this._entityId = value;
    }
    // Temporarily expose input value. Use with caution.
    get entityIdInput() {
        return this._entityId;
    }
    // metadata_content - computed: false, optional: false, required: true
    _metadataContent;
    get metadataContent() {
        return this.getStringAttribute('metadata_content');
    }
    set metadataContent(value) {
        this._metadataContent = value;
    }
    // Temporarily expose input value. Use with caution.
    get metadataContentInput() {
        return this._metadataContent;
    }
}
export function elasticsearchDomainSamlOptionsSamlOptionsToTerraform(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 {
        enabled: cdktf.booleanToTerraform(struct.enabled),
        master_backend_role: cdktf.stringToTerraform(struct.masterBackendRole),
        master_user_name: cdktf.stringToTerraform(struct.masterUserName),
        roles_key: cdktf.stringToTerraform(struct.rolesKey),
        session_timeout_minutes: cdktf.numberToTerraform(struct.sessionTimeoutMinutes),
        subject_key: cdktf.stringToTerraform(struct.subjectKey),
        idp: elasticsearchDomainSamlOptionsSamlOptionsIdpToTerraform(struct.idp),
    };
}
export class ElasticsearchDomainSamlOptionsSamlOptionsOutputReference 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._enabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.enabled = this._enabled;
        }
        if (this._masterBackendRole !== undefined) {
            hasAnyValues = true;
            internalValueResult.masterBackendRole = this._masterBackendRole;
        }
        if (this._masterUserName !== undefined) {
            hasAnyValues = true;
            internalValueResult.masterUserName = this._masterUserName;
        }
        if (this._rolesKey !== undefined) {
            hasAnyValues = true;
            internalValueResult.rolesKey = this._rolesKey;
        }
        if (this._sessionTimeoutMinutes !== undefined) {
            hasAnyValues = true;
            internalValueResult.sessionTimeoutMinutes = this._sessionTimeoutMinutes;
        }
        if (this._subjectKey !== undefined) {
            hasAnyValues = true;
            internalValueResult.subjectKey = this._subjectKey;
        }
        if (this._idp?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.idp = this._idp?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._enabled = undefined;
            this._masterBackendRole = undefined;
            this._masterUserName = undefined;
            this._rolesKey = undefined;
            this._sessionTimeoutMinutes = undefined;
            this._subjectKey = undefined;
            this._idp.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._enabled = value.enabled;
            this._masterBackendRole = value.masterBackendRole;
            this._masterUserName = value.masterUserName;
            this._rolesKey = value.rolesKey;
            this._sessionTimeoutMinutes = value.sessionTimeoutMinutes;
            this._subjectKey = value.subjectKey;
            this._idp.internalValue = value.idp;
        }
    }
    // enabled - computed: false, optional: true, required: false
    _enabled;
    get enabled() {
        return this.getBooleanAttribute('enabled');
    }
    set enabled(value) {
        this._enabled = value;
    }
    resetEnabled() {
        this._enabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enabledInput() {
        return this._enabled;
    }
    // master_backend_role - computed: false, optional: true, required: false
    _masterBackendRole;
    get masterBackendRole() {
        return this.getStringAttribute('master_backend_role');
    }
    set masterBackendRole(value) {
        this._masterBackendRole = value;
    }
    resetMasterBackendRole() {
        this._masterBackendRole = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get masterBackendRoleInput() {
        return this._masterBackendRole;
    }
    // master_user_name - computed: false, optional: true, required: false
    _masterUserName;
    get masterUserName() {
        return this.getStringAttribute('master_user_name');
    }
    set masterUserName(value) {
        this._masterUserName = value;
    }
    resetMasterUserName() {
        this._masterUserName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get masterUserNameInput() {
        return this._masterUserName;
    }
    // roles_key - computed: false, optional: true, required: false
    _rolesKey;
    get rolesKey() {
        return this.getStringAttribute('roles_key');
    }
    set rolesKey(value) {
        this._rolesKey = value;
    }
    resetRolesKey() {
        this._rolesKey = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rolesKeyInput() {
        return this._rolesKey;
    }
    // session_timeout_minutes - computed: false, optional: true, required: false
    _sessionTimeoutMinutes;
    get sessionTimeoutMinutes() {
        return this.getNumberAttribute('session_timeout_minutes');
    }
    set sessionTimeoutMinutes(value) {
        this._sessionTimeoutMinutes = value;
    }
    resetSessionTimeoutMinutes() {
        this._sessionTimeoutMinutes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sessionTimeoutMinutesInput() {
        return this._sessionTimeoutMinutes;
    }
    // subject_key - computed: false, optional: true, required: false
    _subjectKey;
    get subjectKey() {
        return this.getStringAttribute('subject_key');
    }
    set subjectKey(value) {
        this._subjectKey = value;
    }
    resetSubjectKey() {
        this._subjectKey = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get subjectKeyInput() {
        return this._subjectKey;
    }
    // idp - computed: false, optional: true, required: false
    _idp = new ElasticsearchDomainSamlOptionsSamlOptionsIdpOutputReference(this, "idp", true);
    get idp() {
        return this._idp;
    }
    putIdp(value) {
        this._idp.internalValue = value;
    }
    resetIdp() {
        this._idp.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get idpInput() {
        return this._idp.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain_saml_options aws_elasticsearch_domain_saml_options}
*/
export class ElasticsearchDomainSamlOptions extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_elasticsearch_domain_saml_options";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain_saml_options aws_elasticsearch_domain_saml_options} 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 ElasticsearchDomainSamlOptionsConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_elasticsearch_domain_saml_options',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._domainName = config.domainName;
        this._samlOptions.internalValue = config.samlOptions;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // domain_name - computed: false, optional: false, required: true
    _domainName;
    get domainName() {
        return this.getStringAttribute('domain_name');
    }
    set domainName(value) {
        this._domainName = value;
    }
    // Temporarily expose input value. Use with caution.
    get domainNameInput() {
        return this._domainName;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // saml_options - computed: false, optional: true, required: false
    _samlOptions = new ElasticsearchDomainSamlOptionsSamlOptionsOutputReference(this, "saml_options", true);
    get samlOptions() {
        return this._samlOptions;
    }
    putSamlOptions(value) {
        this._samlOptions.internalValue = value;
    }
    resetSamlOptions() {
        this._samlOptions.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get samlOptionsInput() {
        return this._samlOptions.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            domain_name: cdktf.stringToTerraform(this._domainName),
            saml_options: elasticsearchDomainSamlOptionsSamlOptionsToTerraform(this._samlOptions.internalValue),
        };
    }
}
//# sourceMappingURL=elasticsearch-domain-saml-options.js.map