// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function efsAccessPointPosixUserToTerraform(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 {
        gid: cdktf.numberToTerraform(struct.gid),
        secondary_gids: cdktf.listMapper(cdktf.numberToTerraform)(struct.secondaryGids),
        uid: cdktf.numberToTerraform(struct.uid),
    };
}
export class EfsAccessPointPosixUserOutputReference 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._gid !== undefined) {
            hasAnyValues = true;
            internalValueResult.gid = this._gid;
        }
        if (this._secondaryGids !== undefined) {
            hasAnyValues = true;
            internalValueResult.secondaryGids = this._secondaryGids;
        }
        if (this._uid !== undefined) {
            hasAnyValues = true;
            internalValueResult.uid = this._uid;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._gid = undefined;
            this._secondaryGids = undefined;
            this._uid = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._gid = value.gid;
            this._secondaryGids = value.secondaryGids;
            this._uid = value.uid;
        }
    }
    // gid - computed: false, optional: false, required: true
    _gid;
    get gid() {
        return this.getNumberAttribute('gid');
    }
    set gid(value) {
        this._gid = value;
    }
    // Temporarily expose input value. Use with caution.
    get gidInput() {
        return this._gid;
    }
    // secondary_gids - computed: false, optional: true, required: false
    _secondaryGids;
    get secondaryGids() {
        return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('secondary_gids')));
    }
    set secondaryGids(value) {
        this._secondaryGids = value;
    }
    resetSecondaryGids() {
        this._secondaryGids = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get secondaryGidsInput() {
        return this._secondaryGids;
    }
    // uid - computed: false, optional: false, required: true
    _uid;
    get uid() {
        return this.getNumberAttribute('uid');
    }
    set uid(value) {
        this._uid = value;
    }
    // Temporarily expose input value. Use with caution.
    get uidInput() {
        return this._uid;
    }
}
export function efsAccessPointRootDirectoryCreationInfoToTerraform(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 {
        owner_gid: cdktf.numberToTerraform(struct.ownerGid),
        owner_uid: cdktf.numberToTerraform(struct.ownerUid),
        permissions: cdktf.stringToTerraform(struct.permissions),
    };
}
export class EfsAccessPointRootDirectoryCreationInfoOutputReference 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._ownerGid !== undefined) {
            hasAnyValues = true;
            internalValueResult.ownerGid = this._ownerGid;
        }
        if (this._ownerUid !== undefined) {
            hasAnyValues = true;
            internalValueResult.ownerUid = this._ownerUid;
        }
        if (this._permissions !== undefined) {
            hasAnyValues = true;
            internalValueResult.permissions = this._permissions;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._ownerGid = undefined;
            this._ownerUid = undefined;
            this._permissions = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._ownerGid = value.ownerGid;
            this._ownerUid = value.ownerUid;
            this._permissions = value.permissions;
        }
    }
    // owner_gid - computed: false, optional: false, required: true
    _ownerGid;
    get ownerGid() {
        return this.getNumberAttribute('owner_gid');
    }
    set ownerGid(value) {
        this._ownerGid = value;
    }
    // Temporarily expose input value. Use with caution.
    get ownerGidInput() {
        return this._ownerGid;
    }
    // owner_uid - computed: false, optional: false, required: true
    _ownerUid;
    get ownerUid() {
        return this.getNumberAttribute('owner_uid');
    }
    set ownerUid(value) {
        this._ownerUid = value;
    }
    // Temporarily expose input value. Use with caution.
    get ownerUidInput() {
        return this._ownerUid;
    }
    // permissions - computed: false, optional: false, required: true
    _permissions;
    get permissions() {
        return this.getStringAttribute('permissions');
    }
    set permissions(value) {
        this._permissions = value;
    }
    // Temporarily expose input value. Use with caution.
    get permissionsInput() {
        return this._permissions;
    }
}
export function efsAccessPointRootDirectoryToTerraform(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 {
        path: cdktf.stringToTerraform(struct.path),
        creation_info: efsAccessPointRootDirectoryCreationInfoToTerraform(struct.creationInfo),
    };
}
export class EfsAccessPointRootDirectoryOutputReference 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._path !== undefined) {
            hasAnyValues = true;
            internalValueResult.path = this._path;
        }
        if (this._creationInfo?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.creationInfo = this._creationInfo?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._path = undefined;
            this._creationInfo.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._path = value.path;
            this._creationInfo.internalValue = value.creationInfo;
        }
    }
    // path - computed: true, optional: true, required: false
    _path;
    get path() {
        return this.getStringAttribute('path');
    }
    set path(value) {
        this._path = value;
    }
    resetPath() {
        this._path = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get pathInput() {
        return this._path;
    }
    // creation_info - computed: false, optional: true, required: false
    _creationInfo = new EfsAccessPointRootDirectoryCreationInfoOutputReference(this, "creation_info", true);
    get creationInfo() {
        return this._creationInfo;
    }
    putCreationInfo(value) {
        this._creationInfo.internalValue = value;
    }
    resetCreationInfo() {
        this._creationInfo.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get creationInfoInput() {
        return this._creationInfo.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point aws_efs_access_point}
*/
export class EfsAccessPoint extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_efs_access_point";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/efs_access_point aws_efs_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 EfsAccessPointConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_efs_access_point',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._fileSystemId = config.fileSystemId;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._posixUser.internalValue = config.posixUser;
        this._rootDirectory.internalValue = config.rootDirectory;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // file_system_arn - computed: true, optional: false, required: false
    get fileSystemArn() {
        return this.getStringAttribute('file_system_arn');
    }
    // file_system_id - computed: false, optional: false, required: true
    _fileSystemId;
    get fileSystemId() {
        return this.getStringAttribute('file_system_id');
    }
    set fileSystemId(value) {
        this._fileSystemId = value;
    }
    // Temporarily expose input value. Use with caution.
    get fileSystemIdInput() {
        return this._fileSystemId;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // owner_id - computed: true, optional: false, required: false
    get ownerId() {
        return this.getStringAttribute('owner_id');
    }
    // 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;
    }
    // posix_user - computed: false, optional: true, required: false
    _posixUser = new EfsAccessPointPosixUserOutputReference(this, "posix_user", true);
    get posixUser() {
        return this._posixUser;
    }
    putPosixUser(value) {
        this._posixUser.internalValue = value;
    }
    resetPosixUser() {
        this._posixUser.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get posixUserInput() {
        return this._posixUser.internalValue;
    }
    // root_directory - computed: false, optional: true, required: false
    _rootDirectory = new EfsAccessPointRootDirectoryOutputReference(this, "root_directory", true);
    get rootDirectory() {
        return this._rootDirectory;
    }
    putRootDirectory(value) {
        this._rootDirectory.internalValue = value;
    }
    resetRootDirectory() {
        this._rootDirectory.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rootDirectoryInput() {
        return this._rootDirectory.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            file_system_id: cdktf.stringToTerraform(this._fileSystemId),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            posix_user: efsAccessPointPosixUserToTerraform(this._posixUser.internalValue),
            root_directory: efsAccessPointRootDirectoryToTerraform(this._rootDirectory.internalValue),
        };
    }
}
//# sourceMappingURL=efs-access-point.js.map