// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function workspacesWorkspaceTimeoutsToTerraform(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 WorkspacesWorkspaceTimeoutsOutputReference 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;
    }
}
export function workspacesWorkspaceWorkspacePropertiesToTerraform(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 {
        compute_type_name: cdktf.stringToTerraform(struct.computeTypeName),
        root_volume_size_gib: cdktf.numberToTerraform(struct.rootVolumeSizeGib),
        running_mode: cdktf.stringToTerraform(struct.runningMode),
        running_mode_auto_stop_timeout_in_minutes: cdktf.numberToTerraform(struct.runningModeAutoStopTimeoutInMinutes),
        user_volume_size_gib: cdktf.numberToTerraform(struct.userVolumeSizeGib),
    };
}
export class WorkspacesWorkspaceWorkspacePropertiesOutputReference 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._computeTypeName !== undefined) {
            hasAnyValues = true;
            internalValueResult.computeTypeName = this._computeTypeName;
        }
        if (this._rootVolumeSizeGib !== undefined) {
            hasAnyValues = true;
            internalValueResult.rootVolumeSizeGib = this._rootVolumeSizeGib;
        }
        if (this._runningMode !== undefined) {
            hasAnyValues = true;
            internalValueResult.runningMode = this._runningMode;
        }
        if (this._runningModeAutoStopTimeoutInMinutes !== undefined) {
            hasAnyValues = true;
            internalValueResult.runningModeAutoStopTimeoutInMinutes = this._runningModeAutoStopTimeoutInMinutes;
        }
        if (this._userVolumeSizeGib !== undefined) {
            hasAnyValues = true;
            internalValueResult.userVolumeSizeGib = this._userVolumeSizeGib;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._computeTypeName = undefined;
            this._rootVolumeSizeGib = undefined;
            this._runningMode = undefined;
            this._runningModeAutoStopTimeoutInMinutes = undefined;
            this._userVolumeSizeGib = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._computeTypeName = value.computeTypeName;
            this._rootVolumeSizeGib = value.rootVolumeSizeGib;
            this._runningMode = value.runningMode;
            this._runningModeAutoStopTimeoutInMinutes = value.runningModeAutoStopTimeoutInMinutes;
            this._userVolumeSizeGib = value.userVolumeSizeGib;
        }
    }
    // compute_type_name - computed: false, optional: true, required: false
    _computeTypeName;
    get computeTypeName() {
        return this.getStringAttribute('compute_type_name');
    }
    set computeTypeName(value) {
        this._computeTypeName = value;
    }
    resetComputeTypeName() {
        this._computeTypeName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get computeTypeNameInput() {
        return this._computeTypeName;
    }
    // root_volume_size_gib - computed: false, optional: true, required: false
    _rootVolumeSizeGib;
    get rootVolumeSizeGib() {
        return this.getNumberAttribute('root_volume_size_gib');
    }
    set rootVolumeSizeGib(value) {
        this._rootVolumeSizeGib = value;
    }
    resetRootVolumeSizeGib() {
        this._rootVolumeSizeGib = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rootVolumeSizeGibInput() {
        return this._rootVolumeSizeGib;
    }
    // running_mode - computed: false, optional: true, required: false
    _runningMode;
    get runningMode() {
        return this.getStringAttribute('running_mode');
    }
    set runningMode(value) {
        this._runningMode = value;
    }
    resetRunningMode() {
        this._runningMode = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get runningModeInput() {
        return this._runningMode;
    }
    // running_mode_auto_stop_timeout_in_minutes - computed: true, optional: true, required: false
    _runningModeAutoStopTimeoutInMinutes;
    get runningModeAutoStopTimeoutInMinutes() {
        return this.getNumberAttribute('running_mode_auto_stop_timeout_in_minutes');
    }
    set runningModeAutoStopTimeoutInMinutes(value) {
        this._runningModeAutoStopTimeoutInMinutes = value;
    }
    resetRunningModeAutoStopTimeoutInMinutes() {
        this._runningModeAutoStopTimeoutInMinutes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get runningModeAutoStopTimeoutInMinutesInput() {
        return this._runningModeAutoStopTimeoutInMinutes;
    }
    // user_volume_size_gib - computed: false, optional: true, required: false
    _userVolumeSizeGib;
    get userVolumeSizeGib() {
        return this.getNumberAttribute('user_volume_size_gib');
    }
    set userVolumeSizeGib(value) {
        this._userVolumeSizeGib = value;
    }
    resetUserVolumeSizeGib() {
        this._userVolumeSizeGib = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get userVolumeSizeGibInput() {
        return this._userVolumeSizeGib;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/workspaces_workspace aws_workspaces_workspace}
*/
export class WorkspacesWorkspace extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_workspaces_workspace";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/workspaces_workspace aws_workspaces_workspace} 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 WorkspacesWorkspaceConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_workspaces_workspace',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._bundleId = config.bundleId;
        this._directoryId = config.directoryId;
        this._rootVolumeEncryptionEnabled = config.rootVolumeEncryptionEnabled;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._userName = config.userName;
        this._userVolumeEncryptionEnabled = config.userVolumeEncryptionEnabled;
        this._volumeEncryptionKey = config.volumeEncryptionKey;
        this._timeouts.internalValue = config.timeouts;
        this._workspaceProperties.internalValue = config.workspaceProperties;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // bundle_id - computed: false, optional: false, required: true
    _bundleId;
    get bundleId() {
        return this.getStringAttribute('bundle_id');
    }
    set bundleId(value) {
        this._bundleId = value;
    }
    // Temporarily expose input value. Use with caution.
    get bundleIdInput() {
        return this._bundleId;
    }
    // computer_name - computed: true, optional: false, required: false
    get computerName() {
        return this.getStringAttribute('computer_name');
    }
    // directory_id - computed: false, optional: false, required: true
    _directoryId;
    get directoryId() {
        return this.getStringAttribute('directory_id');
    }
    set directoryId(value) {
        this._directoryId = value;
    }
    // Temporarily expose input value. Use with caution.
    get directoryIdInput() {
        return this._directoryId;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // ip_address - computed: true, optional: false, required: false
    get ipAddress() {
        return this.getStringAttribute('ip_address');
    }
    // root_volume_encryption_enabled - computed: false, optional: true, required: false
    _rootVolumeEncryptionEnabled;
    get rootVolumeEncryptionEnabled() {
        return this.getBooleanAttribute('root_volume_encryption_enabled');
    }
    set rootVolumeEncryptionEnabled(value) {
        this._rootVolumeEncryptionEnabled = value;
    }
    resetRootVolumeEncryptionEnabled() {
        this._rootVolumeEncryptionEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rootVolumeEncryptionEnabledInput() {
        return this._rootVolumeEncryptionEnabled;
    }
    // state - computed: true, optional: false, required: false
    get state() {
        return this.getStringAttribute('state');
    }
    // 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;
    }
    // user_name - computed: false, optional: false, required: true
    _userName;
    get userName() {
        return this.getStringAttribute('user_name');
    }
    set userName(value) {
        this._userName = value;
    }
    // Temporarily expose input value. Use with caution.
    get userNameInput() {
        return this._userName;
    }
    // user_volume_encryption_enabled - computed: false, optional: true, required: false
    _userVolumeEncryptionEnabled;
    get userVolumeEncryptionEnabled() {
        return this.getBooleanAttribute('user_volume_encryption_enabled');
    }
    set userVolumeEncryptionEnabled(value) {
        this._userVolumeEncryptionEnabled = value;
    }
    resetUserVolumeEncryptionEnabled() {
        this._userVolumeEncryptionEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get userVolumeEncryptionEnabledInput() {
        return this._userVolumeEncryptionEnabled;
    }
    // volume_encryption_key - computed: false, optional: true, required: false
    _volumeEncryptionKey;
    get volumeEncryptionKey() {
        return this.getStringAttribute('volume_encryption_key');
    }
    set volumeEncryptionKey(value) {
        this._volumeEncryptionKey = value;
    }
    resetVolumeEncryptionKey() {
        this._volumeEncryptionKey = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get volumeEncryptionKeyInput() {
        return this._volumeEncryptionKey;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new WorkspacesWorkspaceTimeoutsOutputReference(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;
    }
    // workspace_properties - computed: false, optional: true, required: false
    _workspaceProperties = new WorkspacesWorkspaceWorkspacePropertiesOutputReference(this, "workspace_properties", true);
    get workspaceProperties() {
        return this._workspaceProperties;
    }
    putWorkspaceProperties(value) {
        this._workspaceProperties.internalValue = value;
    }
    resetWorkspaceProperties() {
        this._workspaceProperties.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get workspacePropertiesInput() {
        return this._workspaceProperties.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            bundle_id: cdktf.stringToTerraform(this._bundleId),
            directory_id: cdktf.stringToTerraform(this._directoryId),
            root_volume_encryption_enabled: cdktf.booleanToTerraform(this._rootVolumeEncryptionEnabled),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            user_name: cdktf.stringToTerraform(this._userName),
            user_volume_encryption_enabled: cdktf.booleanToTerraform(this._userVolumeEncryptionEnabled),
            volume_encryption_key: cdktf.stringToTerraform(this._volumeEncryptionKey),
            timeouts: workspacesWorkspaceTimeoutsToTerraform(this._timeouts.internalValue),
            workspace_properties: workspacesWorkspaceWorkspacePropertiesToTerraform(this._workspaceProperties.internalValue),
        };
    }
}
//# sourceMappingURL=workspaces-workspace.js.map