// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function kmsGrantConstraintsToTerraform(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 {
        encryption_context_equals: cdktf.hashMapper(cdktf.stringToTerraform)(struct.encryptionContextEquals),
        encryption_context_subset: cdktf.hashMapper(cdktf.stringToTerraform)(struct.encryptionContextSubset),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/kms_grant aws_kms_grant}
*/
export class KmsGrant extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_kms_grant";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/kms_grant aws_kms_grant} 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 KmsGrantConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_kms_grant',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._grantCreationTokens = config.grantCreationTokens;
        this._granteePrincipal = config.granteePrincipal;
        this._keyId = config.keyId;
        this._name = config.name;
        this._operations = config.operations;
        this._retireOnDelete = config.retireOnDelete;
        this._retiringPrincipal = config.retiringPrincipal;
        this._constraints = config.constraints;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // grant_creation_tokens - computed: false, optional: true, required: false
    _grantCreationTokens;
    get grantCreationTokens() {
        return cdktf.Fn.tolist(this.getListAttribute('grant_creation_tokens'));
    }
    set grantCreationTokens(value) {
        this._grantCreationTokens = value;
    }
    resetGrantCreationTokens() {
        this._grantCreationTokens = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get grantCreationTokensInput() {
        return this._grantCreationTokens;
    }
    // grant_id - computed: true, optional: false, required: false
    get grantId() {
        return this.getStringAttribute('grant_id');
    }
    // grant_token - computed: true, optional: false, required: false
    get grantToken() {
        return this.getStringAttribute('grant_token');
    }
    // grantee_principal - computed: false, optional: false, required: true
    _granteePrincipal;
    get granteePrincipal() {
        return this.getStringAttribute('grantee_principal');
    }
    set granteePrincipal(value) {
        this._granteePrincipal = value;
    }
    // Temporarily expose input value. Use with caution.
    get granteePrincipalInput() {
        return this._granteePrincipal;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // key_id - computed: false, optional: false, required: true
    _keyId;
    get keyId() {
        return this.getStringAttribute('key_id');
    }
    set keyId(value) {
        this._keyId = value;
    }
    // Temporarily expose input value. Use with caution.
    get keyIdInput() {
        return this._keyId;
    }
    // name - computed: false, optional: true, required: false
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    resetName() {
        this._name = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // operations - computed: false, optional: false, required: true
    _operations;
    get operations() {
        return cdktf.Fn.tolist(this.getListAttribute('operations'));
    }
    set operations(value) {
        this._operations = value;
    }
    // Temporarily expose input value. Use with caution.
    get operationsInput() {
        return this._operations;
    }
    // retire_on_delete - computed: false, optional: true, required: false
    _retireOnDelete;
    get retireOnDelete() {
        return this.getBooleanAttribute('retire_on_delete');
    }
    set retireOnDelete(value) {
        this._retireOnDelete = value;
    }
    resetRetireOnDelete() {
        this._retireOnDelete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get retireOnDeleteInput() {
        return this._retireOnDelete;
    }
    // retiring_principal - computed: false, optional: true, required: false
    _retiringPrincipal;
    get retiringPrincipal() {
        return this.getStringAttribute('retiring_principal');
    }
    set retiringPrincipal(value) {
        this._retiringPrincipal = value;
    }
    resetRetiringPrincipal() {
        this._retiringPrincipal = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get retiringPrincipalInput() {
        return this._retiringPrincipal;
    }
    // constraints - computed: false, optional: true, required: false
    _constraints;
    get constraints() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('constraints')));
    }
    set constraints(value) {
        this._constraints = value;
    }
    resetConstraints() {
        this._constraints = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get constraintsInput() {
        return this._constraints;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            grant_creation_tokens: cdktf.listMapper(cdktf.stringToTerraform)(this._grantCreationTokens),
            grantee_principal: cdktf.stringToTerraform(this._granteePrincipal),
            key_id: cdktf.stringToTerraform(this._keyId),
            name: cdktf.stringToTerraform(this._name),
            operations: cdktf.listMapper(cdktf.stringToTerraform)(this._operations),
            retire_on_delete: cdktf.booleanToTerraform(this._retireOnDelete),
            retiring_principal: cdktf.stringToTerraform(this._retiringPrincipal),
            constraints: cdktf.listMapper(kmsGrantConstraintsToTerraform)(this._constraints),
        };
    }
}
//# sourceMappingURL=kms-grant.js.map