// https://www.terraform.io/docs/providers/aws/r/cloudsearch_domain
// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function cloudsearchDomainEndpointOptionsToTerraform(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 {
        enforce_https: cdktf.booleanToTerraform(struct.enforceHttps),
        tls_security_policy: cdktf.stringToTerraform(struct.tlsSecurityPolicy),
    };
}
export class CloudsearchDomainEndpointOptionsOutputReference 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._enforceHttps !== undefined) {
            hasAnyValues = true;
            internalValueResult.enforceHttps = this._enforceHttps;
        }
        if (this._tlsSecurityPolicy !== undefined) {
            hasAnyValues = true;
            internalValueResult.tlsSecurityPolicy = this._tlsSecurityPolicy;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._enforceHttps = undefined;
            this._tlsSecurityPolicy = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._enforceHttps = value.enforceHttps;
            this._tlsSecurityPolicy = value.tlsSecurityPolicy;
        }
    }
    // enforce_https - computed: true, optional: true, required: false
    _enforceHttps;
    get enforceHttps() {
        return this.getBooleanAttribute('enforce_https');
    }
    set enforceHttps(value) {
        this._enforceHttps = value;
    }
    resetEnforceHttps() {
        this._enforceHttps = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enforceHttpsInput() {
        return this._enforceHttps;
    }
    // tls_security_policy - computed: true, optional: true, required: false
    _tlsSecurityPolicy;
    get tlsSecurityPolicy() {
        return this.getStringAttribute('tls_security_policy');
    }
    set tlsSecurityPolicy(value) {
        this._tlsSecurityPolicy = value;
    }
    resetTlsSecurityPolicy() {
        this._tlsSecurityPolicy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tlsSecurityPolicyInput() {
        return this._tlsSecurityPolicy;
    }
}
export function cloudsearchDomainIndexFieldToTerraform(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 {
        analysis_scheme: cdktf.stringToTerraform(struct.analysisScheme),
        default_value: cdktf.stringToTerraform(struct.defaultValue),
        facet: cdktf.booleanToTerraform(struct.facet),
        highlight: cdktf.booleanToTerraform(struct.highlight),
        name: cdktf.stringToTerraform(struct.name),
        return: cdktf.booleanToTerraform(struct.return),
        search: cdktf.booleanToTerraform(struct.search),
        sort: cdktf.booleanToTerraform(struct.sort),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export function cloudsearchDomainScalingParametersToTerraform(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 {
        desired_instance_type: cdktf.stringToTerraform(struct.desiredInstanceType),
        desired_partition_count: cdktf.numberToTerraform(struct.desiredPartitionCount),
        desired_replication_count: cdktf.numberToTerraform(struct.desiredReplicationCount),
    };
}
export class CloudsearchDomainScalingParametersOutputReference 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._desiredInstanceType !== undefined) {
            hasAnyValues = true;
            internalValueResult.desiredInstanceType = this._desiredInstanceType;
        }
        if (this._desiredPartitionCount !== undefined) {
            hasAnyValues = true;
            internalValueResult.desiredPartitionCount = this._desiredPartitionCount;
        }
        if (this._desiredReplicationCount !== undefined) {
            hasAnyValues = true;
            internalValueResult.desiredReplicationCount = this._desiredReplicationCount;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._desiredInstanceType = undefined;
            this._desiredPartitionCount = undefined;
            this._desiredReplicationCount = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._desiredInstanceType = value.desiredInstanceType;
            this._desiredPartitionCount = value.desiredPartitionCount;
            this._desiredReplicationCount = value.desiredReplicationCount;
        }
    }
    // desired_instance_type - computed: true, optional: true, required: false
    _desiredInstanceType;
    get desiredInstanceType() {
        return this.getStringAttribute('desired_instance_type');
    }
    set desiredInstanceType(value) {
        this._desiredInstanceType = value;
    }
    resetDesiredInstanceType() {
        this._desiredInstanceType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get desiredInstanceTypeInput() {
        return this._desiredInstanceType;
    }
    // desired_partition_count - computed: true, optional: true, required: false
    _desiredPartitionCount;
    get desiredPartitionCount() {
        return this.getNumberAttribute('desired_partition_count');
    }
    set desiredPartitionCount(value) {
        this._desiredPartitionCount = value;
    }
    resetDesiredPartitionCount() {
        this._desiredPartitionCount = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get desiredPartitionCountInput() {
        return this._desiredPartitionCount;
    }
    // desired_replication_count - computed: true, optional: true, required: false
    _desiredReplicationCount;
    get desiredReplicationCount() {
        return this.getNumberAttribute('desired_replication_count');
    }
    set desiredReplicationCount(value) {
        this._desiredReplicationCount = value;
    }
    resetDesiredReplicationCount() {
        this._desiredReplicationCount = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get desiredReplicationCountInput() {
        return this._desiredReplicationCount;
    }
}
export function cloudsearchDomainTimeoutsToTerraform(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 {
        create: cdktf.stringToTerraform(struct.create),
        delete: cdktf.stringToTerraform(struct.delete),
        update: cdktf.stringToTerraform(struct.update),
    };
}
export class CloudsearchDomainTimeoutsOutputReference 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._create !== undefined) {
            hasAnyValues = true;
            internalValueResult.create = this._create;
        }
        if (this._delete !== undefined) {
            hasAnyValues = true;
            internalValueResult.delete = this._delete;
        }
        if (this._update !== undefined) {
            hasAnyValues = true;
            internalValueResult.update = this._update;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._create = undefined;
            this._delete = undefined;
            this._update = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._create = value.create;
            this._delete = value.delete;
            this._update = value.update;
        }
    }
    // create - computed: false, optional: true, required: false
    _create;
    get create() {
        return this.getStringAttribute('create');
    }
    set create(value) {
        this._create = value;
    }
    resetCreate() {
        this._create = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get createInput() {
        return this._create;
    }
    // delete - computed: false, optional: true, required: false
    _delete;
    get delete() {
        return this.getStringAttribute('delete');
    }
    set delete(value) {
        this._delete = value;
    }
    resetDelete() {
        this._delete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deleteInput() {
        return this._delete;
    }
    // update - computed: false, optional: true, required: false
    _update;
    get update() {
        return this.getStringAttribute('update');
    }
    set update(value) {
        this._update = value;
    }
    resetUpdate() {
        this._update = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get updateInput() {
        return this._update;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cloudsearch_domain aws_cloudsearch_domain}
*/
export class CloudsearchDomain extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_cloudsearch_domain";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/cloudsearch_domain aws_cloudsearch_domain} 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 CloudsearchDomainConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_cloudsearch_domain',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._multiAz = config.multiAz;
        this._name = config.name;
        this._endpointOptions.internalValue = config.endpointOptions;
        this._indexField = config.indexField;
        this._scalingParameters.internalValue = config.scalingParameters;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // document_service_endpoint - computed: true, optional: false, required: false
    get documentServiceEndpoint() {
        return this.getStringAttribute('document_service_endpoint');
    }
    // domain_id - computed: true, optional: false, required: false
    get domainId() {
        return this.getStringAttribute('domain_id');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // multi_az - computed: true, optional: true, required: false
    _multiAz;
    get multiAz() {
        return this.getBooleanAttribute('multi_az');
    }
    set multiAz(value) {
        this._multiAz = value;
    }
    resetMultiAz() {
        this._multiAz = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get multiAzInput() {
        return this._multiAz;
    }
    // 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;
    }
    // search_service_endpoint - computed: true, optional: false, required: false
    get searchServiceEndpoint() {
        return this.getStringAttribute('search_service_endpoint');
    }
    // endpoint_options - computed: false, optional: true, required: false
    _endpointOptions = new CloudsearchDomainEndpointOptionsOutputReference(this, "endpoint_options", true);
    get endpointOptions() {
        return this._endpointOptions;
    }
    putEndpointOptions(value) {
        this._endpointOptions.internalValue = value;
    }
    resetEndpointOptions() {
        this._endpointOptions.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get endpointOptionsInput() {
        return this._endpointOptions.internalValue;
    }
    // index_field - computed: false, optional: true, required: false
    _indexField;
    get indexField() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('index_field')));
    }
    set indexField(value) {
        this._indexField = value;
    }
    resetIndexField() {
        this._indexField = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get indexFieldInput() {
        return this._indexField;
    }
    // scaling_parameters - computed: false, optional: true, required: false
    _scalingParameters = new CloudsearchDomainScalingParametersOutputReference(this, "scaling_parameters", true);
    get scalingParameters() {
        return this._scalingParameters;
    }
    putScalingParameters(value) {
        this._scalingParameters.internalValue = value;
    }
    resetScalingParameters() {
        this._scalingParameters.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get scalingParametersInput() {
        return this._scalingParameters.internalValue;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new CloudsearchDomainTimeoutsOutputReference(this, "timeouts", true);
    get timeouts() {
        return this._timeouts;
    }
    putTimeouts(value) {
        this._timeouts.internalValue = value;
    }
    resetTimeouts() {
        this._timeouts.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutsInput() {
        return this._timeouts.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            multi_az: cdktf.booleanToTerraform(this._multiAz),
            name: cdktf.stringToTerraform(this._name),
            endpoint_options: cloudsearchDomainEndpointOptionsToTerraform(this._endpointOptions.internalValue),
            index_field: cdktf.listMapper(cloudsearchDomainIndexFieldToTerraform)(this._indexField),
            scaling_parameters: cloudsearchDomainScalingParametersToTerraform(this._scalingParameters.internalValue),
            timeouts: cloudsearchDomainTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=cloudsearch-domain.js.map