// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function batchSchedulingPolicyFairSharePolicyShareDistributionToTerraform(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 {
        share_identifier: cdktf.stringToTerraform(struct.shareIdentifier),
        weight_factor: cdktf.numberToTerraform(struct.weightFactor),
    };
}
export function batchSchedulingPolicyFairSharePolicyToTerraform(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 {
        compute_reservation: cdktf.numberToTerraform(struct.computeReservation),
        share_decay_seconds: cdktf.numberToTerraform(struct.shareDecaySeconds),
        share_distribution: cdktf.listMapper(batchSchedulingPolicyFairSharePolicyShareDistributionToTerraform)(struct.shareDistribution),
    };
}
export class BatchSchedulingPolicyFairSharePolicyOutputReference 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._computeReservation !== undefined) {
            hasAnyValues = true;
            internalValueResult.computeReservation = this._computeReservation;
        }
        if (this._shareDecaySeconds !== undefined) {
            hasAnyValues = true;
            internalValueResult.shareDecaySeconds = this._shareDecaySeconds;
        }
        if (this._shareDistribution !== undefined) {
            hasAnyValues = true;
            internalValueResult.shareDistribution = this._shareDistribution;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._computeReservation = undefined;
            this._shareDecaySeconds = undefined;
            this._shareDistribution = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._computeReservation = value.computeReservation;
            this._shareDecaySeconds = value.shareDecaySeconds;
            this._shareDistribution = value.shareDistribution;
        }
    }
    // compute_reservation - computed: false, optional: true, required: false
    _computeReservation;
    get computeReservation() {
        return this.getNumberAttribute('compute_reservation');
    }
    set computeReservation(value) {
        this._computeReservation = value;
    }
    resetComputeReservation() {
        this._computeReservation = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get computeReservationInput() {
        return this._computeReservation;
    }
    // share_decay_seconds - computed: false, optional: true, required: false
    _shareDecaySeconds;
    get shareDecaySeconds() {
        return this.getNumberAttribute('share_decay_seconds');
    }
    set shareDecaySeconds(value) {
        this._shareDecaySeconds = value;
    }
    resetShareDecaySeconds() {
        this._shareDecaySeconds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get shareDecaySecondsInput() {
        return this._shareDecaySeconds;
    }
    // share_distribution - computed: false, optional: true, required: false
    _shareDistribution;
    get shareDistribution() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('share_distribution')));
    }
    set shareDistribution(value) {
        this._shareDistribution = value;
    }
    resetShareDistribution() {
        this._shareDistribution = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get shareDistributionInput() {
        return this._shareDistribution;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/batch_scheduling_policy aws_batch_scheduling_policy}
*/
export class BatchSchedulingPolicy extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_batch_scheduling_policy";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/batch_scheduling_policy aws_batch_scheduling_policy} 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 BatchSchedulingPolicyConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_batch_scheduling_policy',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._fairSharePolicy.internalValue = config.fairSharePolicy;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // 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;
    }
    // fair_share_policy - computed: false, optional: true, required: false
    _fairSharePolicy = new BatchSchedulingPolicyFairSharePolicyOutputReference(this, "fair_share_policy", true);
    get fairSharePolicy() {
        return this._fairSharePolicy;
    }
    putFairSharePolicy(value) {
        this._fairSharePolicy.internalValue = value;
    }
    resetFairSharePolicy() {
        this._fairSharePolicy.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get fairSharePolicyInput() {
        return this._fairSharePolicy.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            fair_share_policy: batchSchedulingPolicyFairSharePolicyToTerraform(this._fairSharePolicy.internalValue),
        };
    }
}
//# sourceMappingURL=batch-scheduling-policy.js.map