// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function imagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationLaunchPermissionToTerraform(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 {
        user_groups: cdktf.listMapper(cdktf.stringToTerraform)(struct.userGroups),
        user_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct.userIds),
    };
}
export class ImagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationLaunchPermissionOutputReference 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._userGroups !== undefined) {
            hasAnyValues = true;
            internalValueResult.userGroups = this._userGroups;
        }
        if (this._userIds !== undefined) {
            hasAnyValues = true;
            internalValueResult.userIds = this._userIds;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._userGroups = undefined;
            this._userIds = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._userGroups = value.userGroups;
            this._userIds = value.userIds;
        }
    }
    // user_groups - computed: false, optional: true, required: false
    _userGroups;
    get userGroups() {
        return cdktf.Fn.tolist(this.getListAttribute('user_groups'));
    }
    set userGroups(value) {
        this._userGroups = value;
    }
    resetUserGroups() {
        this._userGroups = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get userGroupsInput() {
        return this._userGroups;
    }
    // user_ids - computed: false, optional: true, required: false
    _userIds;
    get userIds() {
        return cdktf.Fn.tolist(this.getListAttribute('user_ids'));
    }
    set userIds(value) {
        this._userIds = value;
    }
    resetUserIds() {
        this._userIds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get userIdsInput() {
        return this._userIds;
    }
}
export function imagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationToTerraform(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 {
        ami_tags: cdktf.hashMapper(cdktf.stringToTerraform)(struct.amiTags),
        description: cdktf.stringToTerraform(struct.description),
        kms_key_id: cdktf.stringToTerraform(struct.kmsKeyId),
        name: cdktf.stringToTerraform(struct.name),
        target_account_ids: cdktf.listMapper(cdktf.stringToTerraform)(struct.targetAccountIds),
        launch_permission: imagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationLaunchPermissionToTerraform(struct.launchPermission),
    };
}
export class ImagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationOutputReference 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._amiTags !== undefined) {
            hasAnyValues = true;
            internalValueResult.amiTags = this._amiTags;
        }
        if (this._description !== undefined) {
            hasAnyValues = true;
            internalValueResult.description = this._description;
        }
        if (this._kmsKeyId !== undefined) {
            hasAnyValues = true;
            internalValueResult.kmsKeyId = this._kmsKeyId;
        }
        if (this._name !== undefined) {
            hasAnyValues = true;
            internalValueResult.name = this._name;
        }
        if (this._targetAccountIds !== undefined) {
            hasAnyValues = true;
            internalValueResult.targetAccountIds = this._targetAccountIds;
        }
        if (this._launchPermission?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.launchPermission = this._launchPermission?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._amiTags = undefined;
            this._description = undefined;
            this._kmsKeyId = undefined;
            this._name = undefined;
            this._targetAccountIds = undefined;
            this._launchPermission.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._amiTags = value.amiTags;
            this._description = value.description;
            this._kmsKeyId = value.kmsKeyId;
            this._name = value.name;
            this._targetAccountIds = value.targetAccountIds;
            this._launchPermission.internalValue = value.launchPermission;
        }
    }
    // ami_tags - computed: false, optional: true, required: false
    _amiTags;
    get amiTags() {
        return this.getStringMapAttribute('ami_tags');
    }
    set amiTags(value) {
        this._amiTags = value;
    }
    resetAmiTags() {
        this._amiTags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get amiTagsInput() {
        return this._amiTags;
    }
    // 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;
    }
    // kms_key_id - computed: false, optional: true, required: false
    _kmsKeyId;
    get kmsKeyId() {
        return this.getStringAttribute('kms_key_id');
    }
    set kmsKeyId(value) {
        this._kmsKeyId = value;
    }
    resetKmsKeyId() {
        this._kmsKeyId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get kmsKeyIdInput() {
        return this._kmsKeyId;
    }
    // name - computed: false, 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;
    }
    // target_account_ids - computed: false, optional: true, required: false
    _targetAccountIds;
    get targetAccountIds() {
        return cdktf.Fn.tolist(this.getListAttribute('target_account_ids'));
    }
    set targetAccountIds(value) {
        this._targetAccountIds = value;
    }
    resetTargetAccountIds() {
        this._targetAccountIds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get targetAccountIdsInput() {
        return this._targetAccountIds;
    }
    // launch_permission - computed: false, optional: true, required: false
    _launchPermission = new ImagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationLaunchPermissionOutputReference(this, "launch_permission", true);
    get launchPermission() {
        return this._launchPermission;
    }
    putLaunchPermission(value) {
        this._launchPermission.internalValue = value;
    }
    resetLaunchPermission() {
        this._launchPermission.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get launchPermissionInput() {
        return this._launchPermission.internalValue;
    }
}
export function imagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationTargetRepositoryToTerraform(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 {
        repository_name: cdktf.stringToTerraform(struct.repositoryName),
        service: cdktf.stringToTerraform(struct.service),
    };
}
export class ImagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationTargetRepositoryOutputReference 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._repositoryName !== undefined) {
            hasAnyValues = true;
            internalValueResult.repositoryName = this._repositoryName;
        }
        if (this._service !== undefined) {
            hasAnyValues = true;
            internalValueResult.service = this._service;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._repositoryName = undefined;
            this._service = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._repositoryName = value.repositoryName;
            this._service = value.service;
        }
    }
    // repository_name - computed: false, optional: false, required: true
    _repositoryName;
    get repositoryName() {
        return this.getStringAttribute('repository_name');
    }
    set repositoryName(value) {
        this._repositoryName = value;
    }
    // Temporarily expose input value. Use with caution.
    get repositoryNameInput() {
        return this._repositoryName;
    }
    // service - computed: false, optional: false, required: true
    _service;
    get service() {
        return this.getStringAttribute('service');
    }
    set service(value) {
        this._service = value;
    }
    // Temporarily expose input value. Use with caution.
    get serviceInput() {
        return this._service;
    }
}
export function imagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationToTerraform(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 {
        container_tags: cdktf.listMapper(cdktf.stringToTerraform)(struct.containerTags),
        description: cdktf.stringToTerraform(struct.description),
        target_repository: imagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationTargetRepositoryToTerraform(struct.targetRepository),
    };
}
export class ImagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationOutputReference 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._containerTags !== undefined) {
            hasAnyValues = true;
            internalValueResult.containerTags = this._containerTags;
        }
        if (this._description !== undefined) {
            hasAnyValues = true;
            internalValueResult.description = this._description;
        }
        if (this._targetRepository?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.targetRepository = this._targetRepository?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._containerTags = undefined;
            this._description = undefined;
            this._targetRepository.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._containerTags = value.containerTags;
            this._description = value.description;
            this._targetRepository.internalValue = value.targetRepository;
        }
    }
    // container_tags - computed: false, optional: true, required: false
    _containerTags;
    get containerTags() {
        return cdktf.Fn.tolist(this.getListAttribute('container_tags'));
    }
    set containerTags(value) {
        this._containerTags = value;
    }
    resetContainerTags() {
        this._containerTags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get containerTagsInput() {
        return this._containerTags;
    }
    // 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;
    }
    // target_repository - computed: false, optional: false, required: true
    _targetRepository = new ImagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationTargetRepositoryOutputReference(this, "target_repository", true);
    get targetRepository() {
        return this._targetRepository;
    }
    putTargetRepository(value) {
        this._targetRepository.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get targetRepositoryInput() {
        return this._targetRepository.internalValue;
    }
}
export function imagebuilderDistributionConfigurationDistributionLaunchTemplateConfigurationToTerraform(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 {
        default: cdktf.booleanToTerraform(struct.default),
        launch_template_id: cdktf.stringToTerraform(struct.launchTemplateId),
    };
}
export function imagebuilderDistributionConfigurationDistributionToTerraform(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 {
        license_configuration_arns: cdktf.listMapper(cdktf.stringToTerraform)(struct.licenseConfigurationArns),
        region: cdktf.stringToTerraform(struct.region),
        ami_distribution_configuration: imagebuilderDistributionConfigurationDistributionAmiDistributionConfigurationToTerraform(struct.amiDistributionConfiguration),
        container_distribution_configuration: imagebuilderDistributionConfigurationDistributionContainerDistributionConfigurationToTerraform(struct.containerDistributionConfiguration),
        launch_template_configuration: cdktf.listMapper(imagebuilderDistributionConfigurationDistributionLaunchTemplateConfigurationToTerraform)(struct.launchTemplateConfiguration),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/imagebuilder_distribution_configuration aws_imagebuilder_distribution_configuration}
*/
export class ImagebuilderDistributionConfiguration extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_imagebuilder_distribution_configuration";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/imagebuilder_distribution_configuration aws_imagebuilder_distribution_configuration} 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 ImagebuilderDistributionConfigurationConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_imagebuilder_distribution_configuration',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._description = config.description;
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._distribution = config.distribution;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // date_created - computed: true, optional: false, required: false
    get dateCreated() {
        return this.getStringAttribute('date_created');
    }
    // date_updated - computed: true, optional: false, required: false
    get dateUpdated() {
        return this.getStringAttribute('date_updated');
    }
    // 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;
    }
    // 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;
    }
    // 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;
    }
    // distribution - computed: false, optional: false, required: true
    _distribution;
    get distribution() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('distribution')));
    }
    set distribution(value) {
        this._distribution = value;
    }
    // Temporarily expose input value. Use with caution.
    get distributionInput() {
        return this._distribution;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            description: cdktf.stringToTerraform(this._description),
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            distribution: cdktf.listMapper(imagebuilderDistributionConfigurationDistributionToTerraform)(this._distribution),
        };
    }
}
//# sourceMappingURL=imagebuilder-distribution-configuration.js.map