// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function appsyncDatasourceDynamodbConfigDeltaSyncConfigToTerraform(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 {
        base_table_ttl: cdktf.numberToTerraform(struct.baseTableTtl),
        delta_sync_table_name: cdktf.stringToTerraform(struct.deltaSyncTableName),
        delta_sync_table_ttl: cdktf.numberToTerraform(struct.deltaSyncTableTtl),
    };
}
export class AppsyncDatasourceDynamodbConfigDeltaSyncConfigOutputReference 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._baseTableTtl !== undefined) {
            hasAnyValues = true;
            internalValueResult.baseTableTtl = this._baseTableTtl;
        }
        if (this._deltaSyncTableName !== undefined) {
            hasAnyValues = true;
            internalValueResult.deltaSyncTableName = this._deltaSyncTableName;
        }
        if (this._deltaSyncTableTtl !== undefined) {
            hasAnyValues = true;
            internalValueResult.deltaSyncTableTtl = this._deltaSyncTableTtl;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._baseTableTtl = undefined;
            this._deltaSyncTableName = undefined;
            this._deltaSyncTableTtl = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._baseTableTtl = value.baseTableTtl;
            this._deltaSyncTableName = value.deltaSyncTableName;
            this._deltaSyncTableTtl = value.deltaSyncTableTtl;
        }
    }
    // base_table_ttl - computed: false, optional: true, required: false
    _baseTableTtl;
    get baseTableTtl() {
        return this.getNumberAttribute('base_table_ttl');
    }
    set baseTableTtl(value) {
        this._baseTableTtl = value;
    }
    resetBaseTableTtl() {
        this._baseTableTtl = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get baseTableTtlInput() {
        return this._baseTableTtl;
    }
    // delta_sync_table_name - computed: false, optional: false, required: true
    _deltaSyncTableName;
    get deltaSyncTableName() {
        return this.getStringAttribute('delta_sync_table_name');
    }
    set deltaSyncTableName(value) {
        this._deltaSyncTableName = value;
    }
    // Temporarily expose input value. Use with caution.
    get deltaSyncTableNameInput() {
        return this._deltaSyncTableName;
    }
    // delta_sync_table_ttl - computed: false, optional: true, required: false
    _deltaSyncTableTtl;
    get deltaSyncTableTtl() {
        return this.getNumberAttribute('delta_sync_table_ttl');
    }
    set deltaSyncTableTtl(value) {
        this._deltaSyncTableTtl = value;
    }
    resetDeltaSyncTableTtl() {
        this._deltaSyncTableTtl = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deltaSyncTableTtlInput() {
        return this._deltaSyncTableTtl;
    }
}
export function appsyncDatasourceDynamodbConfigToTerraform(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 {
        region: cdktf.stringToTerraform(struct.region),
        table_name: cdktf.stringToTerraform(struct.tableName),
        use_caller_credentials: cdktf.booleanToTerraform(struct.useCallerCredentials),
        versioned: cdktf.booleanToTerraform(struct.versioned),
        delta_sync_config: appsyncDatasourceDynamodbConfigDeltaSyncConfigToTerraform(struct.deltaSyncConfig),
    };
}
export class AppsyncDatasourceDynamodbConfigOutputReference 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._region !== undefined) {
            hasAnyValues = true;
            internalValueResult.region = this._region;
        }
        if (this._tableName !== undefined) {
            hasAnyValues = true;
            internalValueResult.tableName = this._tableName;
        }
        if (this._useCallerCredentials !== undefined) {
            hasAnyValues = true;
            internalValueResult.useCallerCredentials = this._useCallerCredentials;
        }
        if (this._versioned !== undefined) {
            hasAnyValues = true;
            internalValueResult.versioned = this._versioned;
        }
        if (this._deltaSyncConfig?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.deltaSyncConfig = this._deltaSyncConfig?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._region = undefined;
            this._tableName = undefined;
            this._useCallerCredentials = undefined;
            this._versioned = undefined;
            this._deltaSyncConfig.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._region = value.region;
            this._tableName = value.tableName;
            this._useCallerCredentials = value.useCallerCredentials;
            this._versioned = value.versioned;
            this._deltaSyncConfig.internalValue = value.deltaSyncConfig;
        }
    }
    // region - computed: true, optional: true, required: false
    _region;
    get region() {
        return this.getStringAttribute('region');
    }
    set region(value) {
        this._region = value;
    }
    resetRegion() {
        this._region = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get regionInput() {
        return this._region;
    }
    // table_name - computed: false, optional: false, required: true
    _tableName;
    get tableName() {
        return this.getStringAttribute('table_name');
    }
    set tableName(value) {
        this._tableName = value;
    }
    // Temporarily expose input value. Use with caution.
    get tableNameInput() {
        return this._tableName;
    }
    // use_caller_credentials - computed: false, optional: true, required: false
    _useCallerCredentials;
    get useCallerCredentials() {
        return this.getBooleanAttribute('use_caller_credentials');
    }
    set useCallerCredentials(value) {
        this._useCallerCredentials = value;
    }
    resetUseCallerCredentials() {
        this._useCallerCredentials = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get useCallerCredentialsInput() {
        return this._useCallerCredentials;
    }
    // versioned - computed: false, optional: true, required: false
    _versioned;
    get versioned() {
        return this.getBooleanAttribute('versioned');
    }
    set versioned(value) {
        this._versioned = value;
    }
    resetVersioned() {
        this._versioned = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get versionedInput() {
        return this._versioned;
    }
    // delta_sync_config - computed: false, optional: true, required: false
    _deltaSyncConfig = new AppsyncDatasourceDynamodbConfigDeltaSyncConfigOutputReference(this, "delta_sync_config", true);
    get deltaSyncConfig() {
        return this._deltaSyncConfig;
    }
    putDeltaSyncConfig(value) {
        this._deltaSyncConfig.internalValue = value;
    }
    resetDeltaSyncConfig() {
        this._deltaSyncConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deltaSyncConfigInput() {
        return this._deltaSyncConfig.internalValue;
    }
}
export function appsyncDatasourceElasticsearchConfigToTerraform(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 {
        endpoint: cdktf.stringToTerraform(struct.endpoint),
        region: cdktf.stringToTerraform(struct.region),
    };
}
export class AppsyncDatasourceElasticsearchConfigOutputReference 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._endpoint !== undefined) {
            hasAnyValues = true;
            internalValueResult.endpoint = this._endpoint;
        }
        if (this._region !== undefined) {
            hasAnyValues = true;
            internalValueResult.region = this._region;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._endpoint = undefined;
            this._region = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._endpoint = value.endpoint;
            this._region = value.region;
        }
    }
    // endpoint - computed: false, optional: false, required: true
    _endpoint;
    get endpoint() {
        return this.getStringAttribute('endpoint');
    }
    set endpoint(value) {
        this._endpoint = value;
    }
    // Temporarily expose input value. Use with caution.
    get endpointInput() {
        return this._endpoint;
    }
    // region - computed: true, optional: true, required: false
    _region;
    get region() {
        return this.getStringAttribute('region');
    }
    set region(value) {
        this._region = value;
    }
    resetRegion() {
        this._region = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get regionInput() {
        return this._region;
    }
}
export function appsyncDatasourceHttpConfigAuthorizationConfigAwsIamConfigToTerraform(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 {
        signing_region: cdktf.stringToTerraform(struct.signingRegion),
        signing_service_name: cdktf.stringToTerraform(struct.signingServiceName),
    };
}
export class AppsyncDatasourceHttpConfigAuthorizationConfigAwsIamConfigOutputReference 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._signingRegion !== undefined) {
            hasAnyValues = true;
            internalValueResult.signingRegion = this._signingRegion;
        }
        if (this._signingServiceName !== undefined) {
            hasAnyValues = true;
            internalValueResult.signingServiceName = this._signingServiceName;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._signingRegion = undefined;
            this._signingServiceName = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._signingRegion = value.signingRegion;
            this._signingServiceName = value.signingServiceName;
        }
    }
    // signing_region - computed: false, optional: true, required: false
    _signingRegion;
    get signingRegion() {
        return this.getStringAttribute('signing_region');
    }
    set signingRegion(value) {
        this._signingRegion = value;
    }
    resetSigningRegion() {
        this._signingRegion = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get signingRegionInput() {
        return this._signingRegion;
    }
    // signing_service_name - computed: false, optional: true, required: false
    _signingServiceName;
    get signingServiceName() {
        return this.getStringAttribute('signing_service_name');
    }
    set signingServiceName(value) {
        this._signingServiceName = value;
    }
    resetSigningServiceName() {
        this._signingServiceName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get signingServiceNameInput() {
        return this._signingServiceName;
    }
}
export function appsyncDatasourceHttpConfigAuthorizationConfigToTerraform(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 {
        authorization_type: cdktf.stringToTerraform(struct.authorizationType),
        aws_iam_config: appsyncDatasourceHttpConfigAuthorizationConfigAwsIamConfigToTerraform(struct.awsIamConfig),
    };
}
export class AppsyncDatasourceHttpConfigAuthorizationConfigOutputReference 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._authorizationType !== undefined) {
            hasAnyValues = true;
            internalValueResult.authorizationType = this._authorizationType;
        }
        if (this._awsIamConfig?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.awsIamConfig = this._awsIamConfig?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._authorizationType = undefined;
            this._awsIamConfig.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._authorizationType = value.authorizationType;
            this._awsIamConfig.internalValue = value.awsIamConfig;
        }
    }
    // authorization_type - computed: false, optional: true, required: false
    _authorizationType;
    get authorizationType() {
        return this.getStringAttribute('authorization_type');
    }
    set authorizationType(value) {
        this._authorizationType = value;
    }
    resetAuthorizationType() {
        this._authorizationType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authorizationTypeInput() {
        return this._authorizationType;
    }
    // aws_iam_config - computed: false, optional: true, required: false
    _awsIamConfig = new AppsyncDatasourceHttpConfigAuthorizationConfigAwsIamConfigOutputReference(this, "aws_iam_config", true);
    get awsIamConfig() {
        return this._awsIamConfig;
    }
    putAwsIamConfig(value) {
        this._awsIamConfig.internalValue = value;
    }
    resetAwsIamConfig() {
        this._awsIamConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get awsIamConfigInput() {
        return this._awsIamConfig.internalValue;
    }
}
export function appsyncDatasourceHttpConfigToTerraform(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 {
        endpoint: cdktf.stringToTerraform(struct.endpoint),
        authorization_config: appsyncDatasourceHttpConfigAuthorizationConfigToTerraform(struct.authorizationConfig),
    };
}
export class AppsyncDatasourceHttpConfigOutputReference 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._endpoint !== undefined) {
            hasAnyValues = true;
            internalValueResult.endpoint = this._endpoint;
        }
        if (this._authorizationConfig?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.authorizationConfig = this._authorizationConfig?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._endpoint = undefined;
            this._authorizationConfig.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._endpoint = value.endpoint;
            this._authorizationConfig.internalValue = value.authorizationConfig;
        }
    }
    // endpoint - computed: false, optional: false, required: true
    _endpoint;
    get endpoint() {
        return this.getStringAttribute('endpoint');
    }
    set endpoint(value) {
        this._endpoint = value;
    }
    // Temporarily expose input value. Use with caution.
    get endpointInput() {
        return this._endpoint;
    }
    // authorization_config - computed: false, optional: true, required: false
    _authorizationConfig = new AppsyncDatasourceHttpConfigAuthorizationConfigOutputReference(this, "authorization_config", true);
    get authorizationConfig() {
        return this._authorizationConfig;
    }
    putAuthorizationConfig(value) {
        this._authorizationConfig.internalValue = value;
    }
    resetAuthorizationConfig() {
        this._authorizationConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get authorizationConfigInput() {
        return this._authorizationConfig.internalValue;
    }
}
export function appsyncDatasourceLambdaConfigToTerraform(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 {
        function_arn: cdktf.stringToTerraform(struct.functionArn),
    };
}
export class AppsyncDatasourceLambdaConfigOutputReference 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._functionArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.functionArn = this._functionArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._functionArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._functionArn = value.functionArn;
        }
    }
    // function_arn - computed: false, optional: false, required: true
    _functionArn;
    get functionArn() {
        return this.getStringAttribute('function_arn');
    }
    set functionArn(value) {
        this._functionArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get functionArnInput() {
        return this._functionArn;
    }
}
export function appsyncDatasourceRelationalDatabaseConfigHttpEndpointConfigToTerraform(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 {
        aws_secret_store_arn: cdktf.stringToTerraform(struct.awsSecretStoreArn),
        database_name: cdktf.stringToTerraform(struct.databaseName),
        db_cluster_identifier: cdktf.stringToTerraform(struct.dbClusterIdentifier),
        region: cdktf.stringToTerraform(struct.region),
        schema: cdktf.stringToTerraform(struct.schema),
    };
}
export class AppsyncDatasourceRelationalDatabaseConfigHttpEndpointConfigOutputReference 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._awsSecretStoreArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.awsSecretStoreArn = this._awsSecretStoreArn;
        }
        if (this._databaseName !== undefined) {
            hasAnyValues = true;
            internalValueResult.databaseName = this._databaseName;
        }
        if (this._dbClusterIdentifier !== undefined) {
            hasAnyValues = true;
            internalValueResult.dbClusterIdentifier = this._dbClusterIdentifier;
        }
        if (this._region !== undefined) {
            hasAnyValues = true;
            internalValueResult.region = this._region;
        }
        if (this._schema !== undefined) {
            hasAnyValues = true;
            internalValueResult.schema = this._schema;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._awsSecretStoreArn = undefined;
            this._databaseName = undefined;
            this._dbClusterIdentifier = undefined;
            this._region = undefined;
            this._schema = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._awsSecretStoreArn = value.awsSecretStoreArn;
            this._databaseName = value.databaseName;
            this._dbClusterIdentifier = value.dbClusterIdentifier;
            this._region = value.region;
            this._schema = value.schema;
        }
    }
    // aws_secret_store_arn - computed: false, optional: false, required: true
    _awsSecretStoreArn;
    get awsSecretStoreArn() {
        return this.getStringAttribute('aws_secret_store_arn');
    }
    set awsSecretStoreArn(value) {
        this._awsSecretStoreArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get awsSecretStoreArnInput() {
        return this._awsSecretStoreArn;
    }
    // database_name - computed: false, optional: true, required: false
    _databaseName;
    get databaseName() {
        return this.getStringAttribute('database_name');
    }
    set databaseName(value) {
        this._databaseName = value;
    }
    resetDatabaseName() {
        this._databaseName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get databaseNameInput() {
        return this._databaseName;
    }
    // db_cluster_identifier - computed: false, optional: false, required: true
    _dbClusterIdentifier;
    get dbClusterIdentifier() {
        return this.getStringAttribute('db_cluster_identifier');
    }
    set dbClusterIdentifier(value) {
        this._dbClusterIdentifier = value;
    }
    // Temporarily expose input value. Use with caution.
    get dbClusterIdentifierInput() {
        return this._dbClusterIdentifier;
    }
    // region - computed: true, optional: true, required: false
    _region;
    get region() {
        return this.getStringAttribute('region');
    }
    set region(value) {
        this._region = value;
    }
    resetRegion() {
        this._region = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get regionInput() {
        return this._region;
    }
    // schema - computed: false, optional: true, required: false
    _schema;
    get schema() {
        return this.getStringAttribute('schema');
    }
    set schema(value) {
        this._schema = value;
    }
    resetSchema() {
        this._schema = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get schemaInput() {
        return this._schema;
    }
}
export function appsyncDatasourceRelationalDatabaseConfigToTerraform(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 {
        source_type: cdktf.stringToTerraform(struct.sourceType),
        http_endpoint_config: appsyncDatasourceRelationalDatabaseConfigHttpEndpointConfigToTerraform(struct.httpEndpointConfig),
    };
}
export class AppsyncDatasourceRelationalDatabaseConfigOutputReference 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._sourceType !== undefined) {
            hasAnyValues = true;
            internalValueResult.sourceType = this._sourceType;
        }
        if (this._httpEndpointConfig?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.httpEndpointConfig = this._httpEndpointConfig?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._sourceType = undefined;
            this._httpEndpointConfig.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._sourceType = value.sourceType;
            this._httpEndpointConfig.internalValue = value.httpEndpointConfig;
        }
    }
    // source_type - computed: false, optional: true, required: false
    _sourceType;
    get sourceType() {
        return this.getStringAttribute('source_type');
    }
    set sourceType(value) {
        this._sourceType = value;
    }
    resetSourceType() {
        this._sourceType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sourceTypeInput() {
        return this._sourceType;
    }
    // http_endpoint_config - computed: false, optional: true, required: false
    _httpEndpointConfig = new AppsyncDatasourceRelationalDatabaseConfigHttpEndpointConfigOutputReference(this, "http_endpoint_config", true);
    get httpEndpointConfig() {
        return this._httpEndpointConfig;
    }
    putHttpEndpointConfig(value) {
        this._httpEndpointConfig.internalValue = value;
    }
    resetHttpEndpointConfig() {
        this._httpEndpointConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get httpEndpointConfigInput() {
        return this._httpEndpointConfig.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/appsync_datasource aws_appsync_datasource}
*/
export class AppsyncDatasource extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_appsync_datasource";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/appsync_datasource aws_appsync_datasource} 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 AppsyncDatasourceConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_appsync_datasource',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._apiId = config.apiId;
        this._description = config.description;
        this._name = config.name;
        this._serviceRoleArn = config.serviceRoleArn;
        this._type = config.type;
        this._dynamodbConfig.internalValue = config.dynamodbConfig;
        this._elasticsearchConfig.internalValue = config.elasticsearchConfig;
        this._httpConfig.internalValue = config.httpConfig;
        this._lambdaConfig.internalValue = config.lambdaConfig;
        this._relationalDatabaseConfig.internalValue = config.relationalDatabaseConfig;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // api_id - computed: false, optional: false, required: true
    _apiId;
    get apiId() {
        return this.getStringAttribute('api_id');
    }
    set apiId(value) {
        this._apiId = value;
    }
    // Temporarily expose input value. Use with caution.
    get apiIdInput() {
        return this._apiId;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // service_role_arn - computed: false, optional: true, required: false
    _serviceRoleArn;
    get serviceRoleArn() {
        return this.getStringAttribute('service_role_arn');
    }
    set serviceRoleArn(value) {
        this._serviceRoleArn = value;
    }
    resetServiceRoleArn() {
        this._serviceRoleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get serviceRoleArnInput() {
        return this._serviceRoleArn;
    }
    // type - computed: false, optional: false, required: true
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
    // dynamodb_config - computed: false, optional: true, required: false
    _dynamodbConfig = new AppsyncDatasourceDynamodbConfigOutputReference(this, "dynamodb_config", true);
    get dynamodbConfig() {
        return this._dynamodbConfig;
    }
    putDynamodbConfig(value) {
        this._dynamodbConfig.internalValue = value;
    }
    resetDynamodbConfig() {
        this._dynamodbConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dynamodbConfigInput() {
        return this._dynamodbConfig.internalValue;
    }
    // elasticsearch_config - computed: false, optional: true, required: false
    _elasticsearchConfig = new AppsyncDatasourceElasticsearchConfigOutputReference(this, "elasticsearch_config", true);
    get elasticsearchConfig() {
        return this._elasticsearchConfig;
    }
    putElasticsearchConfig(value) {
        this._elasticsearchConfig.internalValue = value;
    }
    resetElasticsearchConfig() {
        this._elasticsearchConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get elasticsearchConfigInput() {
        return this._elasticsearchConfig.internalValue;
    }
    // http_config - computed: false, optional: true, required: false
    _httpConfig = new AppsyncDatasourceHttpConfigOutputReference(this, "http_config", true);
    get httpConfig() {
        return this._httpConfig;
    }
    putHttpConfig(value) {
        this._httpConfig.internalValue = value;
    }
    resetHttpConfig() {
        this._httpConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get httpConfigInput() {
        return this._httpConfig.internalValue;
    }
    // lambda_config - computed: false, optional: true, required: false
    _lambdaConfig = new AppsyncDatasourceLambdaConfigOutputReference(this, "lambda_config", true);
    get lambdaConfig() {
        return this._lambdaConfig;
    }
    putLambdaConfig(value) {
        this._lambdaConfig.internalValue = value;
    }
    resetLambdaConfig() {
        this._lambdaConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get lambdaConfigInput() {
        return this._lambdaConfig.internalValue;
    }
    // relational_database_config - computed: false, optional: true, required: false
    _relationalDatabaseConfig = new AppsyncDatasourceRelationalDatabaseConfigOutputReference(this, "relational_database_config", true);
    get relationalDatabaseConfig() {
        return this._relationalDatabaseConfig;
    }
    putRelationalDatabaseConfig(value) {
        this._relationalDatabaseConfig.internalValue = value;
    }
    resetRelationalDatabaseConfig() {
        this._relationalDatabaseConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get relationalDatabaseConfigInput() {
        return this._relationalDatabaseConfig.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            api_id: cdktf.stringToTerraform(this._apiId),
            description: cdktf.stringToTerraform(this._description),
            name: cdktf.stringToTerraform(this._name),
            service_role_arn: cdktf.stringToTerraform(this._serviceRoleArn),
            type: cdktf.stringToTerraform(this._type),
            dynamodb_config: appsyncDatasourceDynamodbConfigToTerraform(this._dynamodbConfig.internalValue),
            elasticsearch_config: appsyncDatasourceElasticsearchConfigToTerraform(this._elasticsearchConfig.internalValue),
            http_config: appsyncDatasourceHttpConfigToTerraform(this._httpConfig.internalValue),
            lambda_config: appsyncDatasourceLambdaConfigToTerraform(this._lambdaConfig.internalValue),
            relational_database_config: appsyncDatasourceRelationalDatabaseConfigToTerraform(this._relationalDatabaseConfig.internalValue),
        };
    }
}
//# sourceMappingURL=appsync-datasource.js.map