// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function codepipelineWebhookAuthenticationConfigurationToTerraform(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 {
        allowed_ip_range: cdktf.stringToTerraform(struct.allowedIpRange),
        secret_token: cdktf.stringToTerraform(struct.secretToken),
    };
}
export class CodepipelineWebhookAuthenticationConfigurationOutputReference 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._allowedIpRange !== undefined) {
            hasAnyValues = true;
            internalValueResult.allowedIpRange = this._allowedIpRange;
        }
        if (this._secretToken !== undefined) {
            hasAnyValues = true;
            internalValueResult.secretToken = this._secretToken;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._allowedIpRange = undefined;
            this._secretToken = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._allowedIpRange = value.allowedIpRange;
            this._secretToken = value.secretToken;
        }
    }
    // allowed_ip_range - computed: false, optional: true, required: false
    _allowedIpRange;
    get allowedIpRange() {
        return this.getStringAttribute('allowed_ip_range');
    }
    set allowedIpRange(value) {
        this._allowedIpRange = value;
    }
    resetAllowedIpRange() {
        this._allowedIpRange = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get allowedIpRangeInput() {
        return this._allowedIpRange;
    }
    // secret_token - computed: false, optional: true, required: false
    _secretToken;
    get secretToken() {
        return this.getStringAttribute('secret_token');
    }
    set secretToken(value) {
        this._secretToken = value;
    }
    resetSecretToken() {
        this._secretToken = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get secretTokenInput() {
        return this._secretToken;
    }
}
export function codepipelineWebhookFilterToTerraform(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 {
        json_path: cdktf.stringToTerraform(struct.jsonPath),
        match_equals: cdktf.stringToTerraform(struct.matchEquals),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/codepipeline_webhook aws_codepipeline_webhook}
*/
export class CodepipelineWebhook extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_codepipeline_webhook";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/codepipeline_webhook aws_codepipeline_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 CodepipelineWebhookConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_codepipeline_webhook',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._authentication = config.authentication;
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._targetAction = config.targetAction;
        this._targetPipeline = config.targetPipeline;
        this._authenticationConfiguration.internalValue = config.authenticationConfiguration;
        this._filter = config.filter;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // authentication - computed: false, optional: false, required: true
    _authentication;
    get authentication() {
        return this.getStringAttribute('authentication');
    }
    set authentication(value) {
        this._authentication = value;
    }
    // Temporarily expose input value. Use with caution.
    get authenticationInput() {
        return this._authentication;
    }
    // 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;
    }
    // target_action - computed: false, optional: false, required: true
    _targetAction;
    get targetAction() {
        return this.getStringAttribute('target_action');
    }
    set targetAction(value) {
        this._targetAction = value;
    }
    // Temporarily expose input value. Use with caution.
    get targetActionInput() {
        return this._targetAction;
    }
    // target_pipeline - computed: false, optional: false, required: true
    _targetPipeline;
    get targetPipeline() {
        return this.getStringAttribute('target_pipeline');
    }
    set targetPipeline(value) {
        this._targetPipeline = value;
    }
    // Temporarily expose input value. Use with caution.
    get targetPipelineInput() {
        return this._targetPipeline;
    }
    // url - computed: true, optional: false, required: false
    get url() {
        return this.getStringAttribute('url');
    }
    // authentication_configuration - computed: false, optional: true, required: false
    _authenticationConfiguration = new CodepipelineWebhookAuthenticationConfigurationOutputReference(this, "authentication_configuration", true);
    get authenticationConfiguration() {
        return this._authenticationConfiguration;
    }
    putAuthenticationConfiguration(value) {
        this._authenticationConfiguration.internalValue = value;
    }
    resetAuthenticationConfiguration() {
        this._authenticationConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authenticationConfigurationInput() {
        return this._authenticationConfiguration.internalValue;
    }
    // filter - computed: false, optional: false, required: true
    _filter;
    get filter() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('filter')));
    }
    set filter(value) {
        this._filter = value;
    }
    // Temporarily expose input value. Use with caution.
    get filterInput() {
        return this._filter;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            authentication: cdktf.stringToTerraform(this._authentication),
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            target_action: cdktf.stringToTerraform(this._targetAction),
            target_pipeline: cdktf.stringToTerraform(this._targetPipeline),
            authentication_configuration: codepipelineWebhookAuthenticationConfigurationToTerraform(this._authenticationConfiguration.internalValue),
            filter: cdktf.listMapper(codepipelineWebhookFilterToTerraform)(this._filter),
        };
    }
}
//# sourceMappingURL=codepipeline-webhook.js.map