// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function guarddutyOrganizationConfigurationDatasourcesS3LogsToTerraform(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 {
        auto_enable: cdktf.booleanToTerraform(struct.autoEnable),
    };
}
export class GuarddutyOrganizationConfigurationDatasourcesS3LogsOutputReference 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._autoEnable !== undefined) {
            hasAnyValues = true;
            internalValueResult.autoEnable = this._autoEnable;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._autoEnable = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._autoEnable = value.autoEnable;
        }
    }
    // auto_enable - computed: false, optional: false, required: true
    _autoEnable;
    get autoEnable() {
        return this.getBooleanAttribute('auto_enable');
    }
    set autoEnable(value) {
        this._autoEnable = value;
    }
    // Temporarily expose input value. Use with caution.
    get autoEnableInput() {
        return this._autoEnable;
    }
}
export function guarddutyOrganizationConfigurationDatasourcesToTerraform(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 {
        s3_logs: guarddutyOrganizationConfigurationDatasourcesS3LogsToTerraform(struct.s3Logs),
    };
}
export class GuarddutyOrganizationConfigurationDatasourcesOutputReference 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._s3Logs?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.s3Logs = this._s3Logs?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._s3Logs.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._s3Logs.internalValue = value.s3Logs;
        }
    }
    // s3_logs - computed: false, optional: true, required: false
    _s3Logs = new GuarddutyOrganizationConfigurationDatasourcesS3LogsOutputReference(this, "s3_logs", true);
    get s3Logs() {
        return this._s3Logs;
    }
    putS3Logs(value) {
        this._s3Logs.internalValue = value;
    }
    resetS3Logs() {
        this._s3Logs.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3LogsInput() {
        return this._s3Logs.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/guardduty_organization_configuration aws_guardduty_organization_configuration}
*/
export class GuarddutyOrganizationConfiguration extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_guardduty_organization_configuration";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/guardduty_organization_configuration aws_guardduty_organization_configuration} 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 GuarddutyOrganizationConfigurationConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_guardduty_organization_configuration',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._autoEnable = config.autoEnable;
        this._detectorId = config.detectorId;
        this._datasources.internalValue = config.datasources;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // auto_enable - computed: false, optional: false, required: true
    _autoEnable;
    get autoEnable() {
        return this.getBooleanAttribute('auto_enable');
    }
    set autoEnable(value) {
        this._autoEnable = value;
    }
    // Temporarily expose input value. Use with caution.
    get autoEnableInput() {
        return this._autoEnable;
    }
    // detector_id - computed: false, optional: false, required: true
    _detectorId;
    get detectorId() {
        return this.getStringAttribute('detector_id');
    }
    set detectorId(value) {
        this._detectorId = value;
    }
    // Temporarily expose input value. Use with caution.
    get detectorIdInput() {
        return this._detectorId;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // datasources - computed: false, optional: true, required: false
    _datasources = new GuarddutyOrganizationConfigurationDatasourcesOutputReference(this, "datasources", true);
    get datasources() {
        return this._datasources;
    }
    putDatasources(value) {
        this._datasources.internalValue = value;
    }
    resetDatasources() {
        this._datasources.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get datasourcesInput() {
        return this._datasources.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            auto_enable: cdktf.booleanToTerraform(this._autoEnable),
            detector_id: cdktf.stringToTerraform(this._detectorId),
            datasources: guarddutyOrganizationConfigurationDatasourcesToTerraform(this._datasources.internalValue),
        };
    }
}
//# sourceMappingURL=guardduty-organization-configuration.js.map