// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function datasyncLocationS3S3ConfigToTerraform(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 {
        bucket_access_role_arn: cdktf.stringToTerraform(struct.bucketAccessRoleArn),
    };
}
export class DatasyncLocationS3S3ConfigOutputReference 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._bucketAccessRoleArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.bucketAccessRoleArn = this._bucketAccessRoleArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._bucketAccessRoleArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._bucketAccessRoleArn = value.bucketAccessRoleArn;
        }
    }
    // bucket_access_role_arn - computed: false, optional: false, required: true
    _bucketAccessRoleArn;
    get bucketAccessRoleArn() {
        return this.getStringAttribute('bucket_access_role_arn');
    }
    set bucketAccessRoleArn(value) {
        this._bucketAccessRoleArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get bucketAccessRoleArnInput() {
        return this._bucketAccessRoleArn;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/datasync_location_s3 aws_datasync_location_s3}
*/
export class DatasyncLocationS3 extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_datasync_location_s3";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/datasync_location_s3 aws_datasync_location_s3} 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 DatasyncLocationS3Config
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_datasync_location_s3',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._agentArns = config.agentArns;
        this._s3BucketArn = config.s3BucketArn;
        this._s3StorageClass = config.s3StorageClass;
        this._subdirectory = config.subdirectory;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._s3Config.internalValue = config.s3Config;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // agent_arns - computed: false, optional: true, required: false
    _agentArns;
    get agentArns() {
        return cdktf.Fn.tolist(this.getListAttribute('agent_arns'));
    }
    set agentArns(value) {
        this._agentArns = value;
    }
    resetAgentArns() {
        this._agentArns = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get agentArnsInput() {
        return this._agentArns;
    }
    // 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');
    }
    // s3_bucket_arn - computed: false, optional: false, required: true
    _s3BucketArn;
    get s3BucketArn() {
        return this.getStringAttribute('s3_bucket_arn');
    }
    set s3BucketArn(value) {
        this._s3BucketArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get s3BucketArnInput() {
        return this._s3BucketArn;
    }
    // s3_storage_class - computed: true, optional: true, required: false
    _s3StorageClass;
    get s3StorageClass() {
        return this.getStringAttribute('s3_storage_class');
    }
    set s3StorageClass(value) {
        this._s3StorageClass = value;
    }
    resetS3StorageClass() {
        this._s3StorageClass = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3StorageClassInput() {
        return this._s3StorageClass;
    }
    // subdirectory - computed: false, optional: false, required: true
    _subdirectory;
    get subdirectory() {
        return this.getStringAttribute('subdirectory');
    }
    set subdirectory(value) {
        this._subdirectory = value;
    }
    // Temporarily expose input value. Use with caution.
    get subdirectoryInput() {
        return this._subdirectory;
    }
    // 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;
    }
    // uri - computed: true, optional: false, required: false
    get uri() {
        return this.getStringAttribute('uri');
    }
    // s3_config - computed: false, optional: false, required: true
    _s3Config = new DatasyncLocationS3S3ConfigOutputReference(this, "s3_config", true);
    get s3Config() {
        return this._s3Config;
    }
    putS3Config(value) {
        this._s3Config.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get s3ConfigInput() {
        return this._s3Config.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            agent_arns: cdktf.listMapper(cdktf.stringToTerraform)(this._agentArns),
            s3_bucket_arn: cdktf.stringToTerraform(this._s3BucketArn),
            s3_storage_class: cdktf.stringToTerraform(this._s3StorageClass),
            subdirectory: cdktf.stringToTerraform(this._subdirectory),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            s3_config: datasyncLocationS3S3ConfigToTerraform(this._s3Config.internalValue),
        };
    }
}
//# sourceMappingURL=datasync-location-s3.js.map