// https://www.terraform.io/docs/providers/aws/r/grafana_workspace
// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function grafanaWorkspaceTimeoutsToTerraform(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),
        update: cdktf.stringToTerraform(struct.update),
    };
}
export class GrafanaWorkspaceTimeoutsOutputReference 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._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._update = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._create = value.create;
            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;
    }
    // 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;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/grafana_workspace aws_grafana_workspace}
*/
export class GrafanaWorkspace extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_grafana_workspace";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/grafana_workspace aws_grafana_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 GrafanaWorkspaceConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_grafana_workspace',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._accountAccessType = config.accountAccessType;
        this._authenticationProviders = config.authenticationProviders;
        this._dataSources = config.dataSources;
        this._description = config.description;
        this._name = config.name;
        this._notificationDestinations = config.notificationDestinations;
        this._organizationRoleName = config.organizationRoleName;
        this._organizationalUnits = config.organizationalUnits;
        this._permissionType = config.permissionType;
        this._roleArn = config.roleArn;
        this._stackSetName = config.stackSetName;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // account_access_type - computed: false, optional: false, required: true
    _accountAccessType;
    get accountAccessType() {
        return this.getStringAttribute('account_access_type');
    }
    set accountAccessType(value) {
        this._accountAccessType = value;
    }
    // Temporarily expose input value. Use with caution.
    get accountAccessTypeInput() {
        return this._accountAccessType;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // authentication_providers - computed: false, optional: false, required: true
    _authenticationProviders;
    get authenticationProviders() {
        return this.getListAttribute('authentication_providers');
    }
    set authenticationProviders(value) {
        this._authenticationProviders = value;
    }
    // Temporarily expose input value. Use with caution.
    get authenticationProvidersInput() {
        return this._authenticationProviders;
    }
    // data_sources - computed: false, optional: true, required: false
    _dataSources;
    get dataSources() {
        return this.getListAttribute('data_sources');
    }
    set dataSources(value) {
        this._dataSources = value;
    }
    resetDataSources() {
        this._dataSources = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dataSourcesInput() {
        return this._dataSources;
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // endpoint - computed: true, optional: false, required: false
    get endpoint() {
        return this.getStringAttribute('endpoint');
    }
    // grafana_version - computed: true, optional: false, required: false
    get grafanaVersion() {
        return this.getStringAttribute('grafana_version');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // name - computed: true, optional: true, required: false
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    resetName() {
        this._name = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // notification_destinations - computed: false, optional: true, required: false
    _notificationDestinations;
    get notificationDestinations() {
        return this.getListAttribute('notification_destinations');
    }
    set notificationDestinations(value) {
        this._notificationDestinations = value;
    }
    resetNotificationDestinations() {
        this._notificationDestinations = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get notificationDestinationsInput() {
        return this._notificationDestinations;
    }
    // organization_role_name - computed: false, optional: true, required: false
    _organizationRoleName;
    get organizationRoleName() {
        return this.getStringAttribute('organization_role_name');
    }
    set organizationRoleName(value) {
        this._organizationRoleName = value;
    }
    resetOrganizationRoleName() {
        this._organizationRoleName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get organizationRoleNameInput() {
        return this._organizationRoleName;
    }
    // organizational_units - computed: false, optional: true, required: false
    _organizationalUnits;
    get organizationalUnits() {
        return this.getListAttribute('organizational_units');
    }
    set organizationalUnits(value) {
        this._organizationalUnits = value;
    }
    resetOrganizationalUnits() {
        this._organizationalUnits = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get organizationalUnitsInput() {
        return this._organizationalUnits;
    }
    // permission_type - computed: false, optional: false, required: true
    _permissionType;
    get permissionType() {
        return this.getStringAttribute('permission_type');
    }
    set permissionType(value) {
        this._permissionType = value;
    }
    // Temporarily expose input value. Use with caution.
    get permissionTypeInput() {
        return this._permissionType;
    }
    // role_arn - computed: false, optional: true, required: false
    _roleArn;
    get roleArn() {
        return this.getStringAttribute('role_arn');
    }
    set roleArn(value) {
        this._roleArn = value;
    }
    resetRoleArn() {
        this._roleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get roleArnInput() {
        return this._roleArn;
    }
    // saml_configuration_status - computed: true, optional: false, required: false
    get samlConfigurationStatus() {
        return this.getStringAttribute('saml_configuration_status');
    }
    // stack_set_name - computed: false, optional: true, required: false
    _stackSetName;
    get stackSetName() {
        return this.getStringAttribute('stack_set_name');
    }
    set stackSetName(value) {
        this._stackSetName = value;
    }
    resetStackSetName() {
        this._stackSetName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get stackSetNameInput() {
        return this._stackSetName;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new GrafanaWorkspaceTimeoutsOutputReference(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;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            account_access_type: cdktf.stringToTerraform(this._accountAccessType),
            authentication_providers: cdktf.listMapper(cdktf.stringToTerraform)(this._authenticationProviders),
            data_sources: cdktf.listMapper(cdktf.stringToTerraform)(this._dataSources),
            description: cdktf.stringToTerraform(this._description),
            name: cdktf.stringToTerraform(this._name),
            notification_destinations: cdktf.listMapper(cdktf.stringToTerraform)(this._notificationDestinations),
            organization_role_name: cdktf.stringToTerraform(this._organizationRoleName),
            organizational_units: cdktf.listMapper(cdktf.stringToTerraform)(this._organizationalUnits),
            permission_type: cdktf.stringToTerraform(this._permissionType),
            role_arn: cdktf.stringToTerraform(this._roleArn),
            stack_set_name: cdktf.stringToTerraform(this._stackSetName),
            timeouts: grafanaWorkspaceTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=grafana-workspace.js.map