// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function codebuildWebhookFilterGroupFilterToTerraform(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 {
        exclude_matched_pattern: cdktf.booleanToTerraform(struct.excludeMatchedPattern),
        pattern: cdktf.stringToTerraform(struct.pattern),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export function codebuildWebhookFilterGroupToTerraform(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 {
        filter: cdktf.listMapper(codebuildWebhookFilterGroupFilterToTerraform)(struct.filter),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/codebuild_webhook aws_codebuild_webhook}
*/
export class CodebuildWebhook extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_codebuild_webhook";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/codebuild_webhook aws_codebuild_webhook} 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 CodebuildWebhookConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_codebuild_webhook',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._branchFilter = config.branchFilter;
        this._buildType = config.buildType;
        this._projectName = config.projectName;
        this._filterGroup = config.filterGroup;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // branch_filter - computed: false, optional: true, required: false
    _branchFilter;
    get branchFilter() {
        return this.getStringAttribute('branch_filter');
    }
    set branchFilter(value) {
        this._branchFilter = value;
    }
    resetBranchFilter() {
        this._branchFilter = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get branchFilterInput() {
        return this._branchFilter;
    }
    // build_type - computed: false, optional: true, required: false
    _buildType;
    get buildType() {
        return this.getStringAttribute('build_type');
    }
    set buildType(value) {
        this._buildType = value;
    }
    resetBuildType() {
        this._buildType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get buildTypeInput() {
        return this._buildType;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // payload_url - computed: true, optional: false, required: false
    get payloadUrl() {
        return this.getStringAttribute('payload_url');
    }
    // project_name - computed: false, optional: false, required: true
    _projectName;
    get projectName() {
        return this.getStringAttribute('project_name');
    }
    set projectName(value) {
        this._projectName = value;
    }
    // Temporarily expose input value. Use with caution.
    get projectNameInput() {
        return this._projectName;
    }
    // secret - computed: true, optional: false, required: false
    get secret() {
        return this.getStringAttribute('secret');
    }
    // url - computed: true, optional: false, required: false
    get url() {
        return this.getStringAttribute('url');
    }
    // filter_group - computed: false, optional: true, required: false
    _filterGroup;
    get filterGroup() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('filter_group')));
    }
    set filterGroup(value) {
        this._filterGroup = value;
    }
    resetFilterGroup() {
        this._filterGroup = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get filterGroupInput() {
        return this._filterGroup;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            branch_filter: cdktf.stringToTerraform(this._branchFilter),
            build_type: cdktf.stringToTerraform(this._buildType),
            project_name: cdktf.stringToTerraform(this._projectName),
            filter_group: cdktf.listMapper(codebuildWebhookFilterGroupToTerraform)(this._filterGroup),
        };
    }
}
//# sourceMappingURL=codebuild-webhook.js.map