// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function dataAwsIamPolicyDocumentStatementConditionToTerraform(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 {
        test: cdktf.stringToTerraform(struct.test),
        values: cdktf.listMapper(cdktf.stringToTerraform)(struct.values),
        variable: cdktf.stringToTerraform(struct.variable),
    };
}
export function dataAwsIamPolicyDocumentStatementNotPrincipalsToTerraform(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 {
        identifiers: cdktf.listMapper(cdktf.stringToTerraform)(struct.identifiers),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export function dataAwsIamPolicyDocumentStatementPrincipalsToTerraform(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 {
        identifiers: cdktf.listMapper(cdktf.stringToTerraform)(struct.identifiers),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export function dataAwsIamPolicyDocumentStatementToTerraform(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 {
        actions: cdktf.listMapper(cdktf.stringToTerraform)(struct.actions),
        effect: cdktf.stringToTerraform(struct.effect),
        not_actions: cdktf.listMapper(cdktf.stringToTerraform)(struct.notActions),
        not_resources: cdktf.listMapper(cdktf.stringToTerraform)(struct.notResources),
        resources: cdktf.listMapper(cdktf.stringToTerraform)(struct.resources),
        sid: cdktf.stringToTerraform(struct.sid),
        condition: cdktf.listMapper(dataAwsIamPolicyDocumentStatementConditionToTerraform)(struct.condition),
        not_principals: cdktf.listMapper(dataAwsIamPolicyDocumentStatementNotPrincipalsToTerraform)(struct.notPrincipals),
        principals: cdktf.listMapper(dataAwsIamPolicyDocumentStatementPrincipalsToTerraform)(struct.principals),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/d/iam_policy_document aws_iam_policy_document}
*/
export class DataAwsIamPolicyDocument extends cdktf.TerraformDataSource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_iam_policy_document";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/d/iam_policy_document aws_iam_policy_document} Data Source
    *
    * @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 DataAwsIamPolicyDocumentConfig = {}
    */
    constructor(scope, id, config = {}) {
        super(scope, id, {
            terraformResourceType: 'aws_iam_policy_document',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._overrideJson = config.overrideJson;
        this._overridePolicyDocuments = config.overridePolicyDocuments;
        this._policyId = config.policyId;
        this._sourceJson = config.sourceJson;
        this._sourcePolicyDocuments = config.sourcePolicyDocuments;
        this._version = config.version;
        this._statement = config.statement;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // json - computed: true, optional: false, required: false
    get json() {
        return this.getStringAttribute('json');
    }
    // override_json - computed: false, optional: true, required: false
    _overrideJson;
    get overrideJson() {
        return this.getStringAttribute('override_json');
    }
    set overrideJson(value) {
        this._overrideJson = value;
    }
    resetOverrideJson() {
        this._overrideJson = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get overrideJsonInput() {
        return this._overrideJson;
    }
    // override_policy_documents - computed: false, optional: true, required: false
    _overridePolicyDocuments;
    get overridePolicyDocuments() {
        return this.getListAttribute('override_policy_documents');
    }
    set overridePolicyDocuments(value) {
        this._overridePolicyDocuments = value;
    }
    resetOverridePolicyDocuments() {
        this._overridePolicyDocuments = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get overridePolicyDocumentsInput() {
        return this._overridePolicyDocuments;
    }
    // policy_id - computed: false, optional: true, required: false
    _policyId;
    get policyId() {
        return this.getStringAttribute('policy_id');
    }
    set policyId(value) {
        this._policyId = value;
    }
    resetPolicyId() {
        this._policyId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get policyIdInput() {
        return this._policyId;
    }
    // source_json - computed: false, optional: true, required: false
    _sourceJson;
    get sourceJson() {
        return this.getStringAttribute('source_json');
    }
    set sourceJson(value) {
        this._sourceJson = value;
    }
    resetSourceJson() {
        this._sourceJson = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sourceJsonInput() {
        return this._sourceJson;
    }
    // source_policy_documents - computed: false, optional: true, required: false
    _sourcePolicyDocuments;
    get sourcePolicyDocuments() {
        return this.getListAttribute('source_policy_documents');
    }
    set sourcePolicyDocuments(value) {
        this._sourcePolicyDocuments = value;
    }
    resetSourcePolicyDocuments() {
        this._sourcePolicyDocuments = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sourcePolicyDocumentsInput() {
        return this._sourcePolicyDocuments;
    }
    // version - computed: false, optional: true, required: false
    _version;
    get version() {
        return this.getStringAttribute('version');
    }
    set version(value) {
        this._version = value;
    }
    resetVersion() {
        this._version = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get versionInput() {
        return this._version;
    }
    // statement - computed: false, optional: true, required: false
    _statement;
    get statement() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('statement');
    }
    set statement(value) {
        this._statement = value;
    }
    resetStatement() {
        this._statement = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statementInput() {
        return this._statement;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            override_json: cdktf.stringToTerraform(this._overrideJson),
            override_policy_documents: cdktf.listMapper(cdktf.stringToTerraform)(this._overridePolicyDocuments),
            policy_id: cdktf.stringToTerraform(this._policyId),
            source_json: cdktf.stringToTerraform(this._sourceJson),
            source_policy_documents: cdktf.listMapper(cdktf.stringToTerraform)(this._sourcePolicyDocuments),
            version: cdktf.stringToTerraform(this._version),
            statement: cdktf.listMapper(dataAwsIamPolicyDocumentStatementToTerraform)(this._statement),
        };
    }
}
//# sourceMappingURL=data-aws-iam-policy-document.js.map