// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function secretsmanagerSecretRotationRotationRulesToTerraform(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 {
        automatically_after_days: cdktf.numberToTerraform(struct.automaticallyAfterDays),
    };
}
export class SecretsmanagerSecretRotationRotationRulesOutputReference 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._automaticallyAfterDays !== undefined) {
            hasAnyValues = true;
            internalValueResult.automaticallyAfterDays = this._automaticallyAfterDays;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._automaticallyAfterDays = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._automaticallyAfterDays = value.automaticallyAfterDays;
        }
    }
    // automatically_after_days - computed: false, optional: false, required: true
    _automaticallyAfterDays;
    get automaticallyAfterDays() {
        return this.getNumberAttribute('automatically_after_days');
    }
    set automaticallyAfterDays(value) {
        this._automaticallyAfterDays = value;
    }
    // Temporarily expose input value. Use with caution.
    get automaticallyAfterDaysInput() {
        return this._automaticallyAfterDays;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret_rotation aws_secretsmanager_secret_rotation}
*/
export class SecretsmanagerSecretRotation extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_secretsmanager_secret_rotation";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret_rotation aws_secretsmanager_secret_rotation} 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 SecretsmanagerSecretRotationConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_secretsmanager_secret_rotation',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._rotationLambdaArn = config.rotationLambdaArn;
        this._secretId = config.secretId;
        this._tags = config.tags;
        this._rotationRules.internalValue = config.rotationRules;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // rotation_enabled - computed: true, optional: false, required: false
    get rotationEnabled() {
        return this.getBooleanAttribute('rotation_enabled');
    }
    // rotation_lambda_arn - computed: false, optional: false, required: true
    _rotationLambdaArn;
    get rotationLambdaArn() {
        return this.getStringAttribute('rotation_lambda_arn');
    }
    set rotationLambdaArn(value) {
        this._rotationLambdaArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get rotationLambdaArnInput() {
        return this._rotationLambdaArn;
    }
    // secret_id - computed: false, optional: false, required: true
    _secretId;
    get secretId() {
        return this.getStringAttribute('secret_id');
    }
    set secretId(value) {
        this._secretId = value;
    }
    // Temporarily expose input value. Use with caution.
    get secretIdInput() {
        return this._secretId;
    }
    // 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;
    }
    // rotation_rules - computed: false, optional: false, required: true
    _rotationRules = new SecretsmanagerSecretRotationRotationRulesOutputReference(this, "rotation_rules", true);
    get rotationRules() {
        return this._rotationRules;
    }
    putRotationRules(value) {
        this._rotationRules.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get rotationRulesInput() {
        return this._rotationRules.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            rotation_lambda_arn: cdktf.stringToTerraform(this._rotationLambdaArn),
            secret_id: cdktf.stringToTerraform(this._secretId),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            rotation_rules: secretsmanagerSecretRotationRotationRulesToTerraform(this._rotationRules.internalValue),
        };
    }
}
//# sourceMappingURL=secretsmanager-secret-rotation.js.map