// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function s3AccessPointPublicAccessBlockConfigurationToTerraform(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 {
        block_public_acls: cdktf.booleanToTerraform(struct.blockPublicAcls),
        block_public_policy: cdktf.booleanToTerraform(struct.blockPublicPolicy),
        ignore_public_acls: cdktf.booleanToTerraform(struct.ignorePublicAcls),
        restrict_public_buckets: cdktf.booleanToTerraform(struct.restrictPublicBuckets),
    };
}
export class S3AccessPointPublicAccessBlockConfigurationOutputReference 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._blockPublicAcls !== undefined) {
            hasAnyValues = true;
            internalValueResult.blockPublicAcls = this._blockPublicAcls;
        }
        if (this._blockPublicPolicy !== undefined) {
            hasAnyValues = true;
            internalValueResult.blockPublicPolicy = this._blockPublicPolicy;
        }
        if (this._ignorePublicAcls !== undefined) {
            hasAnyValues = true;
            internalValueResult.ignorePublicAcls = this._ignorePublicAcls;
        }
        if (this._restrictPublicBuckets !== undefined) {
            hasAnyValues = true;
            internalValueResult.restrictPublicBuckets = this._restrictPublicBuckets;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._blockPublicAcls = undefined;
            this._blockPublicPolicy = undefined;
            this._ignorePublicAcls = undefined;
            this._restrictPublicBuckets = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._blockPublicAcls = value.blockPublicAcls;
            this._blockPublicPolicy = value.blockPublicPolicy;
            this._ignorePublicAcls = value.ignorePublicAcls;
            this._restrictPublicBuckets = value.restrictPublicBuckets;
        }
    }
    // block_public_acls - computed: false, optional: true, required: false
    _blockPublicAcls;
    get blockPublicAcls() {
        return this.getBooleanAttribute('block_public_acls');
    }
    set blockPublicAcls(value) {
        this._blockPublicAcls = value;
    }
    resetBlockPublicAcls() {
        this._blockPublicAcls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get blockPublicAclsInput() {
        return this._blockPublicAcls;
    }
    // block_public_policy - computed: false, optional: true, required: false
    _blockPublicPolicy;
    get blockPublicPolicy() {
        return this.getBooleanAttribute('block_public_policy');
    }
    set blockPublicPolicy(value) {
        this._blockPublicPolicy = value;
    }
    resetBlockPublicPolicy() {
        this._blockPublicPolicy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get blockPublicPolicyInput() {
        return this._blockPublicPolicy;
    }
    // ignore_public_acls - computed: false, optional: true, required: false
    _ignorePublicAcls;
    get ignorePublicAcls() {
        return this.getBooleanAttribute('ignore_public_acls');
    }
    set ignorePublicAcls(value) {
        this._ignorePublicAcls = value;
    }
    resetIgnorePublicAcls() {
        this._ignorePublicAcls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ignorePublicAclsInput() {
        return this._ignorePublicAcls;
    }
    // restrict_public_buckets - computed: false, optional: true, required: false
    _restrictPublicBuckets;
    get restrictPublicBuckets() {
        return this.getBooleanAttribute('restrict_public_buckets');
    }
    set restrictPublicBuckets(value) {
        this._restrictPublicBuckets = value;
    }
    resetRestrictPublicBuckets() {
        this._restrictPublicBuckets = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get restrictPublicBucketsInput() {
        return this._restrictPublicBuckets;
    }
}
export function s3AccessPointVpcConfigurationToTerraform(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 {
        vpc_id: cdktf.stringToTerraform(struct.vpcId),
    };
}
export class S3AccessPointVpcConfigurationOutputReference 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._vpcId !== undefined) {
            hasAnyValues = true;
            internalValueResult.vpcId = this._vpcId;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._vpcId = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._vpcId = value.vpcId;
        }
    }
    // vpc_id - computed: false, optional: false, required: true
    _vpcId;
    get vpcId() {
        return this.getStringAttribute('vpc_id');
    }
    set vpcId(value) {
        this._vpcId = value;
    }
    // Temporarily expose input value. Use with caution.
    get vpcIdInput() {
        return this._vpcId;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/s3_access_point aws_s3_access_point}
*/
export class S3AccessPoint extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_s3_access_point";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/s3_access_point aws_s3_access_point} 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 S3AccessPointConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_s3_access_point',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._accountId = config.accountId;
        this._bucket = config.bucket;
        this._name = config.name;
        this._policy = config.policy;
        this._publicAccessBlockConfiguration.internalValue = config.publicAccessBlockConfiguration;
        this._vpcConfiguration.internalValue = config.vpcConfiguration;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // account_id - computed: true, optional: true, required: false
    _accountId;
    get accountId() {
        return this.getStringAttribute('account_id');
    }
    set accountId(value) {
        this._accountId = value;
    }
    resetAccountId() {
        this._accountId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accountIdInput() {
        return this._accountId;
    }
    // alias - computed: true, optional: false, required: false
    get alias() {
        return this.getStringAttribute('alias');
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // domain_name - computed: true, optional: false, required: false
    get domainName() {
        return this.getStringAttribute('domain_name');
    }
    // endpoints - computed: true, optional: false, required: false
    endpoints(key) {
        return new cdktf.StringMap(this, 'endpoints').lookup(key);
    }
    // has_public_access_policy - computed: true, optional: false, required: false
    get hasPublicAccessPolicy() {
        return this.getBooleanAttribute('has_public_access_policy');
    }
    // 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;
    }
    // network_origin - computed: true, optional: false, required: false
    get networkOrigin() {
        return this.getStringAttribute('network_origin');
    }
    // policy - computed: true, optional: true, required: false
    _policy;
    get policy() {
        return this.getStringAttribute('policy');
    }
    set policy(value) {
        this._policy = value;
    }
    resetPolicy() {
        this._policy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get policyInput() {
        return this._policy;
    }
    // public_access_block_configuration - computed: false, optional: true, required: false
    _publicAccessBlockConfiguration = new S3AccessPointPublicAccessBlockConfigurationOutputReference(this, "public_access_block_configuration", true);
    get publicAccessBlockConfiguration() {
        return this._publicAccessBlockConfiguration;
    }
    putPublicAccessBlockConfiguration(value) {
        this._publicAccessBlockConfiguration.internalValue = value;
    }
    resetPublicAccessBlockConfiguration() {
        this._publicAccessBlockConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get publicAccessBlockConfigurationInput() {
        return this._publicAccessBlockConfiguration.internalValue;
    }
    // vpc_configuration - computed: false, optional: true, required: false
    _vpcConfiguration = new S3AccessPointVpcConfigurationOutputReference(this, "vpc_configuration", true);
    get vpcConfiguration() {
        return this._vpcConfiguration;
    }
    putVpcConfiguration(value) {
        this._vpcConfiguration.internalValue = value;
    }
    resetVpcConfiguration() {
        this._vpcConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get vpcConfigurationInput() {
        return this._vpcConfiguration.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            account_id: cdktf.stringToTerraform(this._accountId),
            bucket: cdktf.stringToTerraform(this._bucket),
            name: cdktf.stringToTerraform(this._name),
            policy: cdktf.stringToTerraform(this._policy),
            public_access_block_configuration: s3AccessPointPublicAccessBlockConfigurationToTerraform(this._publicAccessBlockConfiguration.internalValue),
            vpc_configuration: s3AccessPointVpcConfigurationToTerraform(this._vpcConfiguration.internalValue),
        };
    }
}
//# sourceMappingURL=s3-access-point.js.map