// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function s3BucketWebsiteConfigurationErrorDocumentToTerraform(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 {
        key: cdktf.stringToTerraform(struct.key),
    };
}
export class S3BucketWebsiteConfigurationErrorDocumentOutputReference 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._key !== undefined) {
            hasAnyValues = true;
            internalValueResult.key = this._key;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._key = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._key = value.key;
        }
    }
    // key - computed: false, optional: false, required: true
    _key;
    get key() {
        return this.getStringAttribute('key');
    }
    set key(value) {
        this._key = value;
    }
    // Temporarily expose input value. Use with caution.
    get keyInput() {
        return this._key;
    }
}
export function s3BucketWebsiteConfigurationIndexDocumentToTerraform(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 {
        suffix: cdktf.stringToTerraform(struct.suffix),
    };
}
export class S3BucketWebsiteConfigurationIndexDocumentOutputReference 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._suffix !== undefined) {
            hasAnyValues = true;
            internalValueResult.suffix = this._suffix;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._suffix = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._suffix = value.suffix;
        }
    }
    // suffix - computed: false, optional: false, required: true
    _suffix;
    get suffix() {
        return this.getStringAttribute('suffix');
    }
    set suffix(value) {
        this._suffix = value;
    }
    // Temporarily expose input value. Use with caution.
    get suffixInput() {
        return this._suffix;
    }
}
export function s3BucketWebsiteConfigurationRedirectAllRequestsToToTerraform(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 {
        host_name: cdktf.stringToTerraform(struct.hostName),
        protocol: cdktf.stringToTerraform(struct.protocol),
    };
}
export class S3BucketWebsiteConfigurationRedirectAllRequestsToOutputReference 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._hostName !== undefined) {
            hasAnyValues = true;
            internalValueResult.hostName = this._hostName;
        }
        if (this._protocol !== undefined) {
            hasAnyValues = true;
            internalValueResult.protocol = this._protocol;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._hostName = undefined;
            this._protocol = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._hostName = value.hostName;
            this._protocol = value.protocol;
        }
    }
    // host_name - computed: false, optional: false, required: true
    _hostName;
    get hostName() {
        return this.getStringAttribute('host_name');
    }
    set hostName(value) {
        this._hostName = value;
    }
    // Temporarily expose input value. Use with caution.
    get hostNameInput() {
        return this._hostName;
    }
    // protocol - computed: false, optional: true, required: false
    _protocol;
    get protocol() {
        return this.getStringAttribute('protocol');
    }
    set protocol(value) {
        this._protocol = value;
    }
    resetProtocol() {
        this._protocol = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get protocolInput() {
        return this._protocol;
    }
}
export function s3BucketWebsiteConfigurationRoutingRuleConditionToTerraform(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 {
        http_error_code_returned_equals: cdktf.stringToTerraform(struct.httpErrorCodeReturnedEquals),
        key_prefix_equals: cdktf.stringToTerraform(struct.keyPrefixEquals),
    };
}
export class S3BucketWebsiteConfigurationRoutingRuleConditionOutputReference 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._httpErrorCodeReturnedEquals !== undefined) {
            hasAnyValues = true;
            internalValueResult.httpErrorCodeReturnedEquals = this._httpErrorCodeReturnedEquals;
        }
        if (this._keyPrefixEquals !== undefined) {
            hasAnyValues = true;
            internalValueResult.keyPrefixEquals = this._keyPrefixEquals;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._httpErrorCodeReturnedEquals = undefined;
            this._keyPrefixEquals = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._httpErrorCodeReturnedEquals = value.httpErrorCodeReturnedEquals;
            this._keyPrefixEquals = value.keyPrefixEquals;
        }
    }
    // http_error_code_returned_equals - computed: false, optional: true, required: false
    _httpErrorCodeReturnedEquals;
    get httpErrorCodeReturnedEquals() {
        return this.getStringAttribute('http_error_code_returned_equals');
    }
    set httpErrorCodeReturnedEquals(value) {
        this._httpErrorCodeReturnedEquals = value;
    }
    resetHttpErrorCodeReturnedEquals() {
        this._httpErrorCodeReturnedEquals = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get httpErrorCodeReturnedEqualsInput() {
        return this._httpErrorCodeReturnedEquals;
    }
    // key_prefix_equals - computed: false, optional: true, required: false
    _keyPrefixEquals;
    get keyPrefixEquals() {
        return this.getStringAttribute('key_prefix_equals');
    }
    set keyPrefixEquals(value) {
        this._keyPrefixEquals = value;
    }
    resetKeyPrefixEquals() {
        this._keyPrefixEquals = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get keyPrefixEqualsInput() {
        return this._keyPrefixEquals;
    }
}
export function s3BucketWebsiteConfigurationRoutingRuleRedirectToTerraform(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 {
        host_name: cdktf.stringToTerraform(struct.hostName),
        http_redirect_code: cdktf.stringToTerraform(struct.httpRedirectCode),
        protocol: cdktf.stringToTerraform(struct.protocol),
        replace_key_prefix_with: cdktf.stringToTerraform(struct.replaceKeyPrefixWith),
        replace_key_with: cdktf.stringToTerraform(struct.replaceKeyWith),
    };
}
export class S3BucketWebsiteConfigurationRoutingRuleRedirectOutputReference 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._hostName !== undefined) {
            hasAnyValues = true;
            internalValueResult.hostName = this._hostName;
        }
        if (this._httpRedirectCode !== undefined) {
            hasAnyValues = true;
            internalValueResult.httpRedirectCode = this._httpRedirectCode;
        }
        if (this._protocol !== undefined) {
            hasAnyValues = true;
            internalValueResult.protocol = this._protocol;
        }
        if (this._replaceKeyPrefixWith !== undefined) {
            hasAnyValues = true;
            internalValueResult.replaceKeyPrefixWith = this._replaceKeyPrefixWith;
        }
        if (this._replaceKeyWith !== undefined) {
            hasAnyValues = true;
            internalValueResult.replaceKeyWith = this._replaceKeyWith;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._hostName = undefined;
            this._httpRedirectCode = undefined;
            this._protocol = undefined;
            this._replaceKeyPrefixWith = undefined;
            this._replaceKeyWith = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._hostName = value.hostName;
            this._httpRedirectCode = value.httpRedirectCode;
            this._protocol = value.protocol;
            this._replaceKeyPrefixWith = value.replaceKeyPrefixWith;
            this._replaceKeyWith = value.replaceKeyWith;
        }
    }
    // host_name - computed: false, optional: true, required: false
    _hostName;
    get hostName() {
        return this.getStringAttribute('host_name');
    }
    set hostName(value) {
        this._hostName = value;
    }
    resetHostName() {
        this._hostName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get hostNameInput() {
        return this._hostName;
    }
    // http_redirect_code - computed: false, optional: true, required: false
    _httpRedirectCode;
    get httpRedirectCode() {
        return this.getStringAttribute('http_redirect_code');
    }
    set httpRedirectCode(value) {
        this._httpRedirectCode = value;
    }
    resetHttpRedirectCode() {
        this._httpRedirectCode = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get httpRedirectCodeInput() {
        return this._httpRedirectCode;
    }
    // protocol - computed: false, optional: true, required: false
    _protocol;
    get protocol() {
        return this.getStringAttribute('protocol');
    }
    set protocol(value) {
        this._protocol = value;
    }
    resetProtocol() {
        this._protocol = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get protocolInput() {
        return this._protocol;
    }
    // replace_key_prefix_with - computed: false, optional: true, required: false
    _replaceKeyPrefixWith;
    get replaceKeyPrefixWith() {
        return this.getStringAttribute('replace_key_prefix_with');
    }
    set replaceKeyPrefixWith(value) {
        this._replaceKeyPrefixWith = value;
    }
    resetReplaceKeyPrefixWith() {
        this._replaceKeyPrefixWith = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get replaceKeyPrefixWithInput() {
        return this._replaceKeyPrefixWith;
    }
    // replace_key_with - computed: false, optional: true, required: false
    _replaceKeyWith;
    get replaceKeyWith() {
        return this.getStringAttribute('replace_key_with');
    }
    set replaceKeyWith(value) {
        this._replaceKeyWith = value;
    }
    resetReplaceKeyWith() {
        this._replaceKeyWith = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get replaceKeyWithInput() {
        return this._replaceKeyWith;
    }
}
export function s3BucketWebsiteConfigurationRoutingRuleToTerraform(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 {
        condition: s3BucketWebsiteConfigurationRoutingRuleConditionToTerraform(struct.condition),
        redirect: s3BucketWebsiteConfigurationRoutingRuleRedirectToTerraform(struct.redirect),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/s3_bucket_website_configuration aws_s3_bucket_website_configuration}
*/
export class S3BucketWebsiteConfiguration extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_s3_bucket_website_configuration";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/s3_bucket_website_configuration aws_s3_bucket_website_configuration} 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 S3BucketWebsiteConfigurationConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_s3_bucket_website_configuration',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._bucket = config.bucket;
        this._expectedBucketOwner = config.expectedBucketOwner;
        this._errorDocument.internalValue = config.errorDocument;
        this._indexDocument.internalValue = config.indexDocument;
        this._redirectAllRequestsTo.internalValue = config.redirectAllRequestsTo;
        this._routingRule = config.routingRule;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // bucket - computed: false, optional: false, required: true
    _bucket;
    get bucket() {
        return this.getStringAttribute('bucket');
    }
    set bucket(value) {
        this._bucket = value;
    }
    // Temporarily expose input value. Use with caution.
    get bucketInput() {
        return this._bucket;
    }
    // expected_bucket_owner - computed: false, optional: true, required: false
    _expectedBucketOwner;
    get expectedBucketOwner() {
        return this.getStringAttribute('expected_bucket_owner');
    }
    set expectedBucketOwner(value) {
        this._expectedBucketOwner = value;
    }
    resetExpectedBucketOwner() {
        this._expectedBucketOwner = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get expectedBucketOwnerInput() {
        return this._expectedBucketOwner;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // website_domain - computed: true, optional: false, required: false
    get websiteDomain() {
        return this.getStringAttribute('website_domain');
    }
    // website_endpoint - computed: true, optional: false, required: false
    get websiteEndpoint() {
        return this.getStringAttribute('website_endpoint');
    }
    // error_document - computed: false, optional: true, required: false
    _errorDocument = new S3BucketWebsiteConfigurationErrorDocumentOutputReference(this, "error_document", true);
    get errorDocument() {
        return this._errorDocument;
    }
    putErrorDocument(value) {
        this._errorDocument.internalValue = value;
    }
    resetErrorDocument() {
        this._errorDocument.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get errorDocumentInput() {
        return this._errorDocument.internalValue;
    }
    // index_document - computed: false, optional: true, required: false
    _indexDocument = new S3BucketWebsiteConfigurationIndexDocumentOutputReference(this, "index_document", true);
    get indexDocument() {
        return this._indexDocument;
    }
    putIndexDocument(value) {
        this._indexDocument.internalValue = value;
    }
    resetIndexDocument() {
        this._indexDocument.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get indexDocumentInput() {
        return this._indexDocument.internalValue;
    }
    // redirect_all_requests_to - computed: false, optional: true, required: false
    _redirectAllRequestsTo = new S3BucketWebsiteConfigurationRedirectAllRequestsToOutputReference(this, "redirect_all_requests_to", true);
    get redirectAllRequestsTo() {
        return this._redirectAllRequestsTo;
    }
    putRedirectAllRequestsTo(value) {
        this._redirectAllRequestsTo.internalValue = value;
    }
    resetRedirectAllRequestsTo() {
        this._redirectAllRequestsTo.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get redirectAllRequestsToInput() {
        return this._redirectAllRequestsTo.internalValue;
    }
    // routing_rule - computed: false, optional: true, required: false
    _routingRule;
    get routingRule() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('routing_rule');
    }
    set routingRule(value) {
        this._routingRule = value;
    }
    resetRoutingRule() {
        this._routingRule = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get routingRuleInput() {
        return this._routingRule;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            bucket: cdktf.stringToTerraform(this._bucket),
            expected_bucket_owner: cdktf.stringToTerraform(this._expectedBucketOwner),
            error_document: s3BucketWebsiteConfigurationErrorDocumentToTerraform(this._errorDocument.internalValue),
            index_document: s3BucketWebsiteConfigurationIndexDocumentToTerraform(this._indexDocument.internalValue),
            redirect_all_requests_to: s3BucketWebsiteConfigurationRedirectAllRequestsToToTerraform(this._redirectAllRequestsTo.internalValue),
            routing_rule: cdktf.listMapper(s3BucketWebsiteConfigurationRoutingRuleToTerraform)(this._routingRule),
        };
    }
}
//# sourceMappingURL=s3-bucket-website-configuration.js.map