// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function acmpcaCertificateValidityToTerraform(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 {
        type: cdktf.stringToTerraform(struct.type),
        value: cdktf.stringToTerraform(struct.value),
    };
}
export class AcmpcaCertificateValidityOutputReference 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._type !== undefined) {
            hasAnyValues = true;
            internalValueResult.type = this._type;
        }
        if (this._value !== undefined) {
            hasAnyValues = true;
            internalValueResult.value = this._value;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._type = undefined;
            this._value = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._type = value.type;
            this._value = value.value;
        }
    }
    // type - computed: false, optional: false, required: true
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
    // value - computed: false, optional: false, required: true
    _value;
    get value() {
        return this.getStringAttribute('value');
    }
    set value(value) {
        this._value = value;
    }
    // Temporarily expose input value. Use with caution.
    get valueInput() {
        return this._value;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/acmpca_certificate aws_acmpca_certificate}
*/
export class AcmpcaCertificate extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_acmpca_certificate";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/acmpca_certificate aws_acmpca_certificate} 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 AcmpcaCertificateConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_acmpca_certificate',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._certificateAuthorityArn = config.certificateAuthorityArn;
        this._certificateSigningRequest = config.certificateSigningRequest;
        this._signingAlgorithm = config.signingAlgorithm;
        this._templateArn = config.templateArn;
        this._validity.internalValue = config.validity;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // certificate - computed: true, optional: false, required: false
    get certificate() {
        return this.getStringAttribute('certificate');
    }
    // certificate_authority_arn - computed: false, optional: false, required: true
    _certificateAuthorityArn;
    get certificateAuthorityArn() {
        return this.getStringAttribute('certificate_authority_arn');
    }
    set certificateAuthorityArn(value) {
        this._certificateAuthorityArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get certificateAuthorityArnInput() {
        return this._certificateAuthorityArn;
    }
    // certificate_chain - computed: true, optional: false, required: false
    get certificateChain() {
        return this.getStringAttribute('certificate_chain');
    }
    // certificate_signing_request - computed: false, optional: false, required: true
    _certificateSigningRequest;
    get certificateSigningRequest() {
        return this.getStringAttribute('certificate_signing_request');
    }
    set certificateSigningRequest(value) {
        this._certificateSigningRequest = value;
    }
    // Temporarily expose input value. Use with caution.
    get certificateSigningRequestInput() {
        return this._certificateSigningRequest;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // signing_algorithm - computed: false, optional: false, required: true
    _signingAlgorithm;
    get signingAlgorithm() {
        return this.getStringAttribute('signing_algorithm');
    }
    set signingAlgorithm(value) {
        this._signingAlgorithm = value;
    }
    // Temporarily expose input value. Use with caution.
    get signingAlgorithmInput() {
        return this._signingAlgorithm;
    }
    // template_arn - computed: false, optional: true, required: false
    _templateArn;
    get templateArn() {
        return this.getStringAttribute('template_arn');
    }
    set templateArn(value) {
        this._templateArn = value;
    }
    resetTemplateArn() {
        this._templateArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get templateArnInput() {
        return this._templateArn;
    }
    // validity - computed: false, optional: false, required: true
    _validity = new AcmpcaCertificateValidityOutputReference(this, "validity", true);
    get validity() {
        return this._validity;
    }
    putValidity(value) {
        this._validity.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get validityInput() {
        return this._validity.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            certificate_authority_arn: cdktf.stringToTerraform(this._certificateAuthorityArn),
            certificate_signing_request: cdktf.stringToTerraform(this._certificateSigningRequest),
            signing_algorithm: cdktf.stringToTerraform(this._signingAlgorithm),
            template_arn: cdktf.stringToTerraform(this._templateArn),
            validity: acmpcaCertificateValidityToTerraform(this._validity.internalValue),
        };
    }
}
//# sourceMappingURL=acmpca-certificate.js.map