// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function batchJobDefinitionRetryStrategyEvaluateOnExitToTerraform(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 {
        action: cdktf.stringToTerraform(struct.action),
        on_exit_code: cdktf.stringToTerraform(struct.onExitCode),
        on_reason: cdktf.stringToTerraform(struct.onReason),
        on_status_reason: cdktf.stringToTerraform(struct.onStatusReason),
    };
}
export function batchJobDefinitionRetryStrategyToTerraform(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 {
        attempts: cdktf.numberToTerraform(struct.attempts),
        evaluate_on_exit: cdktf.listMapper(batchJobDefinitionRetryStrategyEvaluateOnExitToTerraform)(struct.evaluateOnExit),
    };
}
export class BatchJobDefinitionRetryStrategyOutputReference 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._attempts !== undefined) {
            hasAnyValues = true;
            internalValueResult.attempts = this._attempts;
        }
        if (this._evaluateOnExit !== undefined) {
            hasAnyValues = true;
            internalValueResult.evaluateOnExit = this._evaluateOnExit;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._attempts = undefined;
            this._evaluateOnExit = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._attempts = value.attempts;
            this._evaluateOnExit = value.evaluateOnExit;
        }
    }
    // attempts - computed: false, optional: true, required: false
    _attempts;
    get attempts() {
        return this.getNumberAttribute('attempts');
    }
    set attempts(value) {
        this._attempts = value;
    }
    resetAttempts() {
        this._attempts = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get attemptsInput() {
        return this._attempts;
    }
    // evaluate_on_exit - computed: false, optional: true, required: false
    _evaluateOnExit;
    get evaluateOnExit() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('evaluate_on_exit');
    }
    set evaluateOnExit(value) {
        this._evaluateOnExit = value;
    }
    resetEvaluateOnExit() {
        this._evaluateOnExit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get evaluateOnExitInput() {
        return this._evaluateOnExit;
    }
}
export function batchJobDefinitionTimeoutToTerraform(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 {
        attempt_duration_seconds: cdktf.numberToTerraform(struct.attemptDurationSeconds),
    };
}
export class BatchJobDefinitionTimeoutOutputReference 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._attemptDurationSeconds !== undefined) {
            hasAnyValues = true;
            internalValueResult.attemptDurationSeconds = this._attemptDurationSeconds;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._attemptDurationSeconds = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._attemptDurationSeconds = value.attemptDurationSeconds;
        }
    }
    // attempt_duration_seconds - computed: false, optional: true, required: false
    _attemptDurationSeconds;
    get attemptDurationSeconds() {
        return this.getNumberAttribute('attempt_duration_seconds');
    }
    set attemptDurationSeconds(value) {
        this._attemptDurationSeconds = value;
    }
    resetAttemptDurationSeconds() {
        this._attemptDurationSeconds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get attemptDurationSecondsInput() {
        return this._attemptDurationSeconds;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition aws_batch_job_definition}
*/
export class BatchJobDefinition extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_batch_job_definition";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/batch_job_definition aws_batch_job_definition} 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 BatchJobDefinitionConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_batch_job_definition',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._containerProperties = config.containerProperties;
        this._name = config.name;
        this._parameters = config.parameters;
        this._platformCapabilities = config.platformCapabilities;
        this._propagateTags = config.propagateTags;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._type = config.type;
        this._retryStrategy.internalValue = config.retryStrategy;
        this._timeout.internalValue = config.timeout;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // container_properties - computed: false, optional: true, required: false
    _containerProperties;
    get containerProperties() {
        return this.getStringAttribute('container_properties');
    }
    set containerProperties(value) {
        this._containerProperties = value;
    }
    resetContainerProperties() {
        this._containerProperties = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get containerPropertiesInput() {
        return this._containerProperties;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // 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;
    }
    // parameters - computed: false, optional: true, required: false
    _parameters;
    get parameters() {
        return this.getStringMapAttribute('parameters');
    }
    set parameters(value) {
        this._parameters = value;
    }
    resetParameters() {
        this._parameters = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get parametersInput() {
        return this._parameters;
    }
    // platform_capabilities - computed: false, optional: true, required: false
    _platformCapabilities;
    get platformCapabilities() {
        return cdktf.Fn.tolist(this.getListAttribute('platform_capabilities'));
    }
    set platformCapabilities(value) {
        this._platformCapabilities = value;
    }
    resetPlatformCapabilities() {
        this._platformCapabilities = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get platformCapabilitiesInput() {
        return this._platformCapabilities;
    }
    // propagate_tags - computed: false, optional: true, required: false
    _propagateTags;
    get propagateTags() {
        return this.getBooleanAttribute('propagate_tags');
    }
    set propagateTags(value) {
        this._propagateTags = value;
    }
    resetPropagateTags() {
        this._propagateTags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get propagateTagsInput() {
        return this._propagateTags;
    }
    // revision - computed: true, optional: false, required: false
    get revision() {
        return this.getNumberAttribute('revision');
    }
    // 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;
    }
    // tags_all - computed: true, optional: true, required: false
    _tagsAll;
    get tagsAll() {
        return this.getStringMapAttribute('tags_all');
    }
    set tagsAll(value) {
        this._tagsAll = value;
    }
    resetTagsAll() {
        this._tagsAll = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsAllInput() {
        return this._tagsAll;
    }
    // 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;
    }
    // retry_strategy - computed: false, optional: true, required: false
    _retryStrategy = new BatchJobDefinitionRetryStrategyOutputReference(this, "retry_strategy", true);
    get retryStrategy() {
        return this._retryStrategy;
    }
    putRetryStrategy(value) {
        this._retryStrategy.internalValue = value;
    }
    resetRetryStrategy() {
        this._retryStrategy.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get retryStrategyInput() {
        return this._retryStrategy.internalValue;
    }
    // timeout - computed: false, optional: true, required: false
    _timeout = new BatchJobDefinitionTimeoutOutputReference(this, "timeout", true);
    get timeout() {
        return this._timeout;
    }
    putTimeout(value) {
        this._timeout.internalValue = value;
    }
    resetTimeout() {
        this._timeout.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutInput() {
        return this._timeout.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            container_properties: cdktf.stringToTerraform(this._containerProperties),
            name: cdktf.stringToTerraform(this._name),
            parameters: cdktf.hashMapper(cdktf.stringToTerraform)(this._parameters),
            platform_capabilities: cdktf.listMapper(cdktf.stringToTerraform)(this._platformCapabilities),
            propagate_tags: cdktf.booleanToTerraform(this._propagateTags),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            type: cdktf.stringToTerraform(this._type),
            retry_strategy: batchJobDefinitionRetryStrategyToTerraform(this._retryStrategy.internalValue),
            timeout: batchJobDefinitionTimeoutToTerraform(this._timeout.internalValue),
        };
    }
}
//# sourceMappingURL=batch-job-definition.js.map