// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function s3BucketVersioningVersioningConfigurationToTerraform(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 {
        mfa_delete: cdktf.stringToTerraform(struct.mfaDelete),
        status: cdktf.stringToTerraform(struct.status),
    };
}
export class S3BucketVersioningVersioningConfigurationOutputReference 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._mfaDelete !== undefined) {
            hasAnyValues = true;
            internalValueResult.mfaDelete = this._mfaDelete;
        }
        if (this._status !== undefined) {
            hasAnyValues = true;
            internalValueResult.status = this._status;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._mfaDelete = undefined;
            this._status = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._mfaDelete = value.mfaDelete;
            this._status = value.status;
        }
    }
    // mfa_delete - computed: true, optional: true, required: false
    _mfaDelete;
    get mfaDelete() {
        return this.getStringAttribute('mfa_delete');
    }
    set mfaDelete(value) {
        this._mfaDelete = value;
    }
    resetMfaDelete() {
        this._mfaDelete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get mfaDeleteInput() {
        return this._mfaDelete;
    }
    // status - computed: false, optional: false, required: true
    _status;
    get status() {
        return this.getStringAttribute('status');
    }
    set status(value) {
        this._status = value;
    }
    // Temporarily expose input value. Use with caution.
    get statusInput() {
        return this._status;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/s3_bucket_versioning aws_s3_bucket_versioning}
*/
export class S3BucketVersioningA extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_s3_bucket_versioning";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/s3_bucket_versioning aws_s3_bucket_versioning} 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 S3BucketVersioningAConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_s3_bucket_versioning',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._bucket = config.bucket;
        this._expectedBucketOwner = config.expectedBucketOwner;
        this._mfa = config.mfa;
        this._versioningConfiguration.internalValue = config.versioningConfiguration;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // bucket - computed: false, optional: false, required: true
    _bucket;
    get bucket() {
        return this.getStringAttribute('bucket');
    }
    set bucket(value) {
        this._bucket = value;
    }
    // Temporarily expose input value. Use with caution.
    get bucketInput() {
        return this._bucket;
    }
    // expected_bucket_owner - computed: false, optional: true, required: false
    _expectedBucketOwner;
    get expectedBucketOwner() {
        return this.getStringAttribute('expected_bucket_owner');
    }
    set expectedBucketOwner(value) {
        this._expectedBucketOwner = value;
    }
    resetExpectedBucketOwner() {
        this._expectedBucketOwner = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get expectedBucketOwnerInput() {
        return this._expectedBucketOwner;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // mfa - computed: false, optional: true, required: false
    _mfa;
    get mfa() {
        return this.getStringAttribute('mfa');
    }
    set mfa(value) {
        this._mfa = value;
    }
    resetMfa() {
        this._mfa = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get mfaInput() {
        return this._mfa;
    }
    // versioning_configuration - computed: false, optional: false, required: true
    _versioningConfiguration = new S3BucketVersioningVersioningConfigurationOutputReference(this, "versioning_configuration", true);
    get versioningConfiguration() {
        return this._versioningConfiguration;
    }
    putVersioningConfiguration(value) {
        this._versioningConfiguration.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get versioningConfigurationInput() {
        return this._versioningConfiguration.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            bucket: cdktf.stringToTerraform(this._bucket),
            expected_bucket_owner: cdktf.stringToTerraform(this._expectedBucketOwner),
            mfa: cdktf.stringToTerraform(this._mfa),
            versioning_configuration: s3BucketVersioningVersioningConfigurationToTerraform(this._versioningConfiguration.internalValue),
        };
    }
}
//# sourceMappingURL=s3-bucket-versioning.js.map