// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function lambdaAliasRoutingConfigToTerraform(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 {
        additional_version_weights: cdktf.hashMapper(cdktf.numberToTerraform)(struct.additionalVersionWeights),
    };
}
export class LambdaAliasRoutingConfigOutputReference 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._additionalVersionWeights !== undefined) {
            hasAnyValues = true;
            internalValueResult.additionalVersionWeights = this._additionalVersionWeights;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._additionalVersionWeights = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._additionalVersionWeights = value.additionalVersionWeights;
        }
    }
    // additional_version_weights - computed: false, optional: true, required: false
    _additionalVersionWeights;
    get additionalVersionWeights() {
        return this.getNumberMapAttribute('additional_version_weights');
    }
    set additionalVersionWeights(value) {
        this._additionalVersionWeights = value;
    }
    resetAdditionalVersionWeights() {
        this._additionalVersionWeights = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get additionalVersionWeightsInput() {
        return this._additionalVersionWeights;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/lambda_alias aws_lambda_alias}
*/
export class LambdaAlias extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_lambda_alias";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/lambda_alias aws_lambda_alias} 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 LambdaAliasConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_lambda_alias',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._description = config.description;
        this._functionName = config.functionName;
        this._functionVersion = config.functionVersion;
        this._name = config.name;
        this._routingConfig.internalValue = config.routingConfig;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // function_name - computed: false, optional: false, required: true
    _functionName;
    get functionName() {
        return this.getStringAttribute('function_name');
    }
    set functionName(value) {
        this._functionName = value;
    }
    // Temporarily expose input value. Use with caution.
    get functionNameInput() {
        return this._functionName;
    }
    // function_version - computed: false, optional: false, required: true
    _functionVersion;
    get functionVersion() {
        return this.getStringAttribute('function_version');
    }
    set functionVersion(value) {
        this._functionVersion = value;
    }
    // Temporarily expose input value. Use with caution.
    get functionVersionInput() {
        return this._functionVersion;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // invoke_arn - computed: true, optional: false, required: false
    get invokeArn() {
        return this.getStringAttribute('invoke_arn');
    }
    // name - computed: false, optional: false, required: true
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // routing_config - computed: false, optional: true, required: false
    _routingConfig = new LambdaAliasRoutingConfigOutputReference(this, "routing_config", true);
    get routingConfig() {
        return this._routingConfig;
    }
    putRoutingConfig(value) {
        this._routingConfig.internalValue = value;
    }
    resetRoutingConfig() {
        this._routingConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get routingConfigInput() {
        return this._routingConfig.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            description: cdktf.stringToTerraform(this._description),
            function_name: cdktf.stringToTerraform(this._functionName),
            function_version: cdktf.stringToTerraform(this._functionVersion),
            name: cdktf.stringToTerraform(this._name),
            routing_config: lambdaAliasRoutingConfigToTerraform(this._routingConfig.internalValue),
        };
    }
}
//# sourceMappingURL=lambda-alias.js.map