UNPKG

@cdktf/provider-newrelic

Version:

Prebuilt newrelic Provider for Terraform CDK (cdktf)

1,285 lines • 282 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; Object.defineProperty(exports, "__esModule", { value: true }); exports.NrqlAlertCondition = exports.NrqlAlertConditionWarningOutputReference = exports.NrqlAlertConditionWarningPredictionOutputReference = exports.NrqlAlertConditionTimeoutsOutputReference = exports.NrqlAlertConditionTermList = exports.NrqlAlertConditionTermOutputReference = exports.NrqlAlertConditionTermPredictionOutputReference = exports.NrqlAlertConditionNrqlOutputReference = exports.NrqlAlertConditionCriticalOutputReference = exports.NrqlAlertConditionCriticalPredictionOutputReference = void 0; exports.nrqlAlertConditionCriticalPredictionToTerraform = nrqlAlertConditionCriticalPredictionToTerraform; exports.nrqlAlertConditionCriticalPredictionToHclTerraform = nrqlAlertConditionCriticalPredictionToHclTerraform; exports.nrqlAlertConditionCriticalToTerraform = nrqlAlertConditionCriticalToTerraform; exports.nrqlAlertConditionCriticalToHclTerraform = nrqlAlertConditionCriticalToHclTerraform; exports.nrqlAlertConditionNrqlToTerraform = nrqlAlertConditionNrqlToTerraform; exports.nrqlAlertConditionNrqlToHclTerraform = nrqlAlertConditionNrqlToHclTerraform; exports.nrqlAlertConditionTermPredictionToTerraform = nrqlAlertConditionTermPredictionToTerraform; exports.nrqlAlertConditionTermPredictionToHclTerraform = nrqlAlertConditionTermPredictionToHclTerraform; exports.nrqlAlertConditionTermToTerraform = nrqlAlertConditionTermToTerraform; exports.nrqlAlertConditionTermToHclTerraform = nrqlAlertConditionTermToHclTerraform; exports.nrqlAlertConditionTimeoutsToTerraform = nrqlAlertConditionTimeoutsToTerraform; exports.nrqlAlertConditionTimeoutsToHclTerraform = nrqlAlertConditionTimeoutsToHclTerraform; exports.nrqlAlertConditionWarningPredictionToTerraform = nrqlAlertConditionWarningPredictionToTerraform; exports.nrqlAlertConditionWarningPredictionToHclTerraform = nrqlAlertConditionWarningPredictionToHclTerraform; exports.nrqlAlertConditionWarningToTerraform = nrqlAlertConditionWarningToTerraform; exports.nrqlAlertConditionWarningToHclTerraform = nrqlAlertConditionWarningToHclTerraform; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function nrqlAlertConditionCriticalPredictionToTerraform(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 { predict_by: cdktf.numberToTerraform(struct.predictBy), prefer_prediction_violation: cdktf.booleanToTerraform(struct.preferPredictionViolation), }; } function nrqlAlertConditionCriticalPredictionToHclTerraform(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"); } const attrs = { predict_by: { value: cdktf.numberToHclTerraform(struct.predictBy), isBlock: false, type: "simple", storageClassType: "number", }, prefer_prediction_violation: { value: cdktf.booleanToHclTerraform(struct.preferPredictionViolation), isBlock: false, type: "simple", storageClassType: "boolean", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionCriticalPredictionOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._predictBy !== undefined) { hasAnyValues = true; internalValueResult.predictBy = this._predictBy; } if (this._preferPredictionViolation !== undefined) { hasAnyValues = true; internalValueResult.preferPredictionViolation = this._preferPredictionViolation; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._predictBy = undefined; this._preferPredictionViolation = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._predictBy = value.predictBy; this._preferPredictionViolation = value.preferPredictionViolation; } } get predictBy() { return this.getNumberAttribute('predict_by'); } set predictBy(value) { this._predictBy = value; } resetPredictBy() { this._predictBy = undefined; } // Temporarily expose input value. Use with caution. get predictByInput() { return this._predictBy; } get preferPredictionViolation() { return this.getBooleanAttribute('prefer_prediction_violation'); } set preferPredictionViolation(value) { this._preferPredictionViolation = value; } resetPreferPredictionViolation() { this._preferPredictionViolation = undefined; } // Temporarily expose input value. Use with caution. get preferPredictionViolationInput() { return this._preferPredictionViolation; } } exports.NrqlAlertConditionCriticalPredictionOutputReference = NrqlAlertConditionCriticalPredictionOutputReference; _a = JSII_RTTI_SYMBOL_1; NrqlAlertConditionCriticalPredictionOutputReference[_a] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionCriticalPredictionOutputReference", version: "12.28.0" }; function nrqlAlertConditionCriticalToTerraform(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 { duration: cdktf.numberToTerraform(struct.duration), operator: cdktf.stringToTerraform(struct.operator), threshold: cdktf.numberToTerraform(struct.threshold), threshold_duration: cdktf.numberToTerraform(struct.thresholdDuration), threshold_occurrences: cdktf.stringToTerraform(struct.thresholdOccurrences), time_function: cdktf.stringToTerraform(struct.timeFunction), prediction: nrqlAlertConditionCriticalPredictionToTerraform(struct.prediction), }; } function nrqlAlertConditionCriticalToHclTerraform(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"); } const attrs = { duration: { value: cdktf.numberToHclTerraform(struct.duration), isBlock: false, type: "simple", storageClassType: "number", }, operator: { value: cdktf.stringToHclTerraform(struct.operator), isBlock: false, type: "simple", storageClassType: "string", }, threshold: { value: cdktf.numberToHclTerraform(struct.threshold), isBlock: false, type: "simple", storageClassType: "number", }, threshold_duration: { value: cdktf.numberToHclTerraform(struct.thresholdDuration), isBlock: false, type: "simple", storageClassType: "number", }, threshold_occurrences: { value: cdktf.stringToHclTerraform(struct.thresholdOccurrences), isBlock: false, type: "simple", storageClassType: "string", }, time_function: { value: cdktf.stringToHclTerraform(struct.timeFunction), isBlock: false, type: "simple", storageClassType: "string", }, prediction: { value: nrqlAlertConditionCriticalPredictionToHclTerraform(struct.prediction), isBlock: true, type: "set", storageClassType: "NrqlAlertConditionCriticalPredictionList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionCriticalOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; // prediction - computed: false, optional: true, required: false this._prediction = new NrqlAlertConditionCriticalPredictionOutputReference(this, "prediction"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._duration !== undefined) { hasAnyValues = true; internalValueResult.duration = this._duration; } if (this._operator !== undefined) { hasAnyValues = true; internalValueResult.operator = this._operator; } if (this._threshold !== undefined) { hasAnyValues = true; internalValueResult.threshold = this._threshold; } if (this._thresholdDuration !== undefined) { hasAnyValues = true; internalValueResult.thresholdDuration = this._thresholdDuration; } if (this._thresholdOccurrences !== undefined) { hasAnyValues = true; internalValueResult.thresholdOccurrences = this._thresholdOccurrences; } if (this._timeFunction !== undefined) { hasAnyValues = true; internalValueResult.timeFunction = this._timeFunction; } if (this._prediction?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.prediction = this._prediction?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._duration = undefined; this._operator = undefined; this._threshold = undefined; this._thresholdDuration = undefined; this._thresholdOccurrences = undefined; this._timeFunction = undefined; this._prediction.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._duration = value.duration; this._operator = value.operator; this._threshold = value.threshold; this._thresholdDuration = value.thresholdDuration; this._thresholdOccurrences = value.thresholdOccurrences; this._timeFunction = value.timeFunction; this._prediction.internalValue = value.prediction; } } get duration() { return this.getNumberAttribute('duration'); } set duration(value) { this._duration = value; } resetDuration() { this._duration = undefined; } // Temporarily expose input value. Use with caution. get durationInput() { return this._duration; } get operator() { return this.getStringAttribute('operator'); } set operator(value) { this._operator = value; } resetOperator() { this._operator = undefined; } // Temporarily expose input value. Use with caution. get operatorInput() { return this._operator; } get threshold() { return this.getNumberAttribute('threshold'); } set threshold(value) { this._threshold = value; } // Temporarily expose input value. Use with caution. get thresholdInput() { return this._threshold; } get thresholdDuration() { return this.getNumberAttribute('threshold_duration'); } set thresholdDuration(value) { this._thresholdDuration = value; } resetThresholdDuration() { this._thresholdDuration = undefined; } // Temporarily expose input value. Use with caution. get thresholdDurationInput() { return this._thresholdDuration; } get thresholdOccurrences() { return this.getStringAttribute('threshold_occurrences'); } set thresholdOccurrences(value) { this._thresholdOccurrences = value; } resetThresholdOccurrences() { this._thresholdOccurrences = undefined; } // Temporarily expose input value. Use with caution. get thresholdOccurrencesInput() { return this._thresholdOccurrences; } get timeFunction() { return this.getStringAttribute('time_function'); } set timeFunction(value) { this._timeFunction = value; } resetTimeFunction() { this._timeFunction = undefined; } // Temporarily expose input value. Use with caution. get timeFunctionInput() { return this._timeFunction; } get prediction() { return this._prediction; } putPrediction(value) { this._prediction.internalValue = value; } resetPrediction() { this._prediction.internalValue = undefined; } // Temporarily expose input value. Use with caution. get predictionInput() { return this._prediction.internalValue; } } exports.NrqlAlertConditionCriticalOutputReference = NrqlAlertConditionCriticalOutputReference; _b = JSII_RTTI_SYMBOL_1; NrqlAlertConditionCriticalOutputReference[_b] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionCriticalOutputReference", version: "12.28.0" }; function nrqlAlertConditionNrqlToTerraform(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 { data_account_id: cdktf.numberToTerraform(struct.dataAccountId), evaluation_offset: cdktf.numberToTerraform(struct.evaluationOffset), query: cdktf.stringToTerraform(struct.query), since_value: cdktf.stringToTerraform(struct.sinceValue), }; } function nrqlAlertConditionNrqlToHclTerraform(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"); } const attrs = { data_account_id: { value: cdktf.numberToHclTerraform(struct.dataAccountId), isBlock: false, type: "simple", storageClassType: "number", }, evaluation_offset: { value: cdktf.numberToHclTerraform(struct.evaluationOffset), isBlock: false, type: "simple", storageClassType: "number", }, query: { value: cdktf.stringToHclTerraform(struct.query), isBlock: false, type: "simple", storageClassType: "string", }, since_value: { value: cdktf.stringToHclTerraform(struct.sinceValue), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionNrqlOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._dataAccountId !== undefined) { hasAnyValues = true; internalValueResult.dataAccountId = this._dataAccountId; } if (this._evaluationOffset !== undefined) { hasAnyValues = true; internalValueResult.evaluationOffset = this._evaluationOffset; } if (this._query !== undefined) { hasAnyValues = true; internalValueResult.query = this._query; } if (this._sinceValue !== undefined) { hasAnyValues = true; internalValueResult.sinceValue = this._sinceValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._dataAccountId = undefined; this._evaluationOffset = undefined; this._query = undefined; this._sinceValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._dataAccountId = value.dataAccountId; this._evaluationOffset = value.evaluationOffset; this._query = value.query; this._sinceValue = value.sinceValue; } } get dataAccountId() { return this.getNumberAttribute('data_account_id'); } set dataAccountId(value) { this._dataAccountId = value; } resetDataAccountId() { this._dataAccountId = undefined; } // Temporarily expose input value. Use with caution. get dataAccountIdInput() { return this._dataAccountId; } get evaluationOffset() { return this.getNumberAttribute('evaluation_offset'); } set evaluationOffset(value) { this._evaluationOffset = value; } resetEvaluationOffset() { this._evaluationOffset = undefined; } // Temporarily expose input value. Use with caution. get evaluationOffsetInput() { return this._evaluationOffset; } get query() { return this.getStringAttribute('query'); } set query(value) { this._query = value; } // Temporarily expose input value. Use with caution. get queryInput() { return this._query; } get sinceValue() { return this.getStringAttribute('since_value'); } set sinceValue(value) { this._sinceValue = value; } resetSinceValue() { this._sinceValue = undefined; } // Temporarily expose input value. Use with caution. get sinceValueInput() { return this._sinceValue; } } exports.NrqlAlertConditionNrqlOutputReference = NrqlAlertConditionNrqlOutputReference; _c = JSII_RTTI_SYMBOL_1; NrqlAlertConditionNrqlOutputReference[_c] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionNrqlOutputReference", version: "12.28.0" }; function nrqlAlertConditionTermPredictionToTerraform(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 { predict_by: cdktf.numberToTerraform(struct.predictBy), prefer_prediction_violation: cdktf.booleanToTerraform(struct.preferPredictionViolation), }; } function nrqlAlertConditionTermPredictionToHclTerraform(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"); } const attrs = { predict_by: { value: cdktf.numberToHclTerraform(struct.predictBy), isBlock: false, type: "simple", storageClassType: "number", }, prefer_prediction_violation: { value: cdktf.booleanToHclTerraform(struct.preferPredictionViolation), isBlock: false, type: "simple", storageClassType: "boolean", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionTermPredictionOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._predictBy !== undefined) { hasAnyValues = true; internalValueResult.predictBy = this._predictBy; } if (this._preferPredictionViolation !== undefined) { hasAnyValues = true; internalValueResult.preferPredictionViolation = this._preferPredictionViolation; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._predictBy = undefined; this._preferPredictionViolation = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._predictBy = value.predictBy; this._preferPredictionViolation = value.preferPredictionViolation; } } get predictBy() { return this.getNumberAttribute('predict_by'); } set predictBy(value) { this._predictBy = value; } resetPredictBy() { this._predictBy = undefined; } // Temporarily expose input value. Use with caution. get predictByInput() { return this._predictBy; } get preferPredictionViolation() { return this.getBooleanAttribute('prefer_prediction_violation'); } set preferPredictionViolation(value) { this._preferPredictionViolation = value; } resetPreferPredictionViolation() { this._preferPredictionViolation = undefined; } // Temporarily expose input value. Use with caution. get preferPredictionViolationInput() { return this._preferPredictionViolation; } } exports.NrqlAlertConditionTermPredictionOutputReference = NrqlAlertConditionTermPredictionOutputReference; _d = JSII_RTTI_SYMBOL_1; NrqlAlertConditionTermPredictionOutputReference[_d] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionTermPredictionOutputReference", version: "12.28.0" }; function nrqlAlertConditionTermToTerraform(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 { duration: cdktf.numberToTerraform(struct.duration), operator: cdktf.stringToTerraform(struct.operator), priority: cdktf.stringToTerraform(struct.priority), threshold: cdktf.numberToTerraform(struct.threshold), threshold_duration: cdktf.numberToTerraform(struct.thresholdDuration), threshold_occurrences: cdktf.stringToTerraform(struct.thresholdOccurrences), time_function: cdktf.stringToTerraform(struct.timeFunction), prediction: nrqlAlertConditionTermPredictionToTerraform(struct.prediction), }; } function nrqlAlertConditionTermToHclTerraform(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"); } const attrs = { duration: { value: cdktf.numberToHclTerraform(struct.duration), isBlock: false, type: "simple", storageClassType: "number", }, operator: { value: cdktf.stringToHclTerraform(struct.operator), isBlock: false, type: "simple", storageClassType: "string", }, priority: { value: cdktf.stringToHclTerraform(struct.priority), isBlock: false, type: "simple", storageClassType: "string", }, threshold: { value: cdktf.numberToHclTerraform(struct.threshold), isBlock: false, type: "simple", storageClassType: "number", }, threshold_duration: { value: cdktf.numberToHclTerraform(struct.thresholdDuration), isBlock: false, type: "simple", storageClassType: "number", }, threshold_occurrences: { value: cdktf.stringToHclTerraform(struct.thresholdOccurrences), isBlock: false, type: "simple", storageClassType: "string", }, time_function: { value: cdktf.stringToHclTerraform(struct.timeFunction), isBlock: false, type: "simple", storageClassType: "string", }, prediction: { value: nrqlAlertConditionTermPredictionToHclTerraform(struct.prediction), isBlock: true, type: "set", storageClassType: "NrqlAlertConditionTermPredictionList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionTermOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) { super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); this.isEmptyObject = false; // prediction - computed: false, optional: true, required: false this._prediction = new NrqlAlertConditionTermPredictionOutputReference(this, "prediction"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._duration !== undefined) { hasAnyValues = true; internalValueResult.duration = this._duration; } if (this._operator !== undefined) { hasAnyValues = true; internalValueResult.operator = this._operator; } if (this._priority !== undefined) { hasAnyValues = true; internalValueResult.priority = this._priority; } if (this._threshold !== undefined) { hasAnyValues = true; internalValueResult.threshold = this._threshold; } if (this._thresholdDuration !== undefined) { hasAnyValues = true; internalValueResult.thresholdDuration = this._thresholdDuration; } if (this._thresholdOccurrences !== undefined) { hasAnyValues = true; internalValueResult.thresholdOccurrences = this._thresholdOccurrences; } if (this._timeFunction !== undefined) { hasAnyValues = true; internalValueResult.timeFunction = this._timeFunction; } if (this._prediction?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.prediction = this._prediction?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._duration = undefined; this._operator = undefined; this._priority = undefined; this._threshold = undefined; this._thresholdDuration = undefined; this._thresholdOccurrences = undefined; this._timeFunction = undefined; this._prediction.internalValue = undefined; } else if (cdktf.Tokenization.isResolvable(value)) { this.isEmptyObject = false; this.resolvableValue = value; } else { this.isEmptyObject = Object.keys(value).length === 0; this.resolvableValue = undefined; this._duration = value.duration; this._operator = value.operator; this._priority = value.priority; this._threshold = value.threshold; this._thresholdDuration = value.thresholdDuration; this._thresholdOccurrences = value.thresholdOccurrences; this._timeFunction = value.timeFunction; this._prediction.internalValue = value.prediction; } } get duration() { return this.getNumberAttribute('duration'); } set duration(value) { this._duration = value; } resetDuration() { this._duration = undefined; } // Temporarily expose input value. Use with caution. get durationInput() { return this._duration; } get operator() { return this.getStringAttribute('operator'); } set operator(value) { this._operator = value; } resetOperator() { this._operator = undefined; } // Temporarily expose input value. Use with caution. get operatorInput() { return this._operator; } get priority() { return this.getStringAttribute('priority'); } set priority(value) { this._priority = value; } resetPriority() { this._priority = undefined; } // Temporarily expose input value. Use with caution. get priorityInput() { return this._priority; } get threshold() { return this.getNumberAttribute('threshold'); } set threshold(value) { this._threshold = value; } // Temporarily expose input value. Use with caution. get thresholdInput() { return this._threshold; } get thresholdDuration() { return this.getNumberAttribute('threshold_duration'); } set thresholdDuration(value) { this._thresholdDuration = value; } resetThresholdDuration() { this._thresholdDuration = undefined; } // Temporarily expose input value. Use with caution. get thresholdDurationInput() { return this._thresholdDuration; } get thresholdOccurrences() { return this.getStringAttribute('threshold_occurrences'); } set thresholdOccurrences(value) { this._thresholdOccurrences = value; } resetThresholdOccurrences() { this._thresholdOccurrences = undefined; } // Temporarily expose input value. Use with caution. get thresholdOccurrencesInput() { return this._thresholdOccurrences; } get timeFunction() { return this.getStringAttribute('time_function'); } set timeFunction(value) { this._timeFunction = value; } resetTimeFunction() { this._timeFunction = undefined; } // Temporarily expose input value. Use with caution. get timeFunctionInput() { return this._timeFunction; } get prediction() { return this._prediction; } putPrediction(value) { this._prediction.internalValue = value; } resetPrediction() { this._prediction.internalValue = undefined; } // Temporarily expose input value. Use with caution. get predictionInput() { return this._prediction.internalValue; } } exports.NrqlAlertConditionTermOutputReference = NrqlAlertConditionTermOutputReference; _e = JSII_RTTI_SYMBOL_1; NrqlAlertConditionTermOutputReference[_e] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionTermOutputReference", version: "12.28.0" }; class NrqlAlertConditionTermList extends cdktf.ComplexList { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, wrapsSet) { super(terraformResource, terraformAttribute, wrapsSet); this.terraformResource = terraformResource; this.terraformAttribute = terraformAttribute; this.wrapsSet = wrapsSet; } /** * @param index the index of the item to return */ get(index) { return new NrqlAlertConditionTermOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.NrqlAlertConditionTermList = NrqlAlertConditionTermList; _f = JSII_RTTI_SYMBOL_1; NrqlAlertConditionTermList[_f] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionTermList", version: "12.28.0" }; function nrqlAlertConditionTimeoutsToTerraform(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 { create: cdktf.stringToTerraform(struct.create), }; } function nrqlAlertConditionTimeoutsToHclTerraform(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"); } const attrs = { create: { value: cdktf.stringToHclTerraform(struct.create), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionTimeoutsOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false); this.isEmptyObject = false; } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._create !== undefined) { hasAnyValues = true; internalValueResult.create = this._create; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._create = undefined; } else if (cdktf.Tokenization.isResolvable(value)) { this.isEmptyObject = false; this.resolvableValue = value; } else { this.isEmptyObject = Object.keys(value).length === 0; this.resolvableValue = undefined; this._create = value.create; } } get create() { return this.getStringAttribute('create'); } set create(value) { this._create = value; } resetCreate() { this._create = undefined; } // Temporarily expose input value. Use with caution. get createInput() { return this._create; } } exports.NrqlAlertConditionTimeoutsOutputReference = NrqlAlertConditionTimeoutsOutputReference; _g = JSII_RTTI_SYMBOL_1; NrqlAlertConditionTimeoutsOutputReference[_g] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionTimeoutsOutputReference", version: "12.28.0" }; function nrqlAlertConditionWarningPredictionToTerraform(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 { predict_by: cdktf.numberToTerraform(struct.predictBy), prefer_prediction_violation: cdktf.booleanToTerraform(struct.preferPredictionViolation), }; } function nrqlAlertConditionWarningPredictionToHclTerraform(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"); } const attrs = { predict_by: { value: cdktf.numberToHclTerraform(struct.predictBy), isBlock: false, type: "simple", storageClassType: "number", }, prefer_prediction_violation: { value: cdktf.booleanToHclTerraform(struct.preferPredictionViolation), isBlock: false, type: "simple", storageClassType: "boolean", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionWarningPredictionOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._predictBy !== undefined) { hasAnyValues = true; internalValueResult.predictBy = this._predictBy; } if (this._preferPredictionViolation !== undefined) { hasAnyValues = true; internalValueResult.preferPredictionViolation = this._preferPredictionViolation; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._predictBy = undefined; this._preferPredictionViolation = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._predictBy = value.predictBy; this._preferPredictionViolation = value.preferPredictionViolation; } } get predictBy() { return this.getNumberAttribute('predict_by'); } set predictBy(value) { this._predictBy = value; } resetPredictBy() { this._predictBy = undefined; } // Temporarily expose input value. Use with caution. get predictByInput() { return this._predictBy; } get preferPredictionViolation() { return this.getBooleanAttribute('prefer_prediction_violation'); } set preferPredictionViolation(value) { this._preferPredictionViolation = value; } resetPreferPredictionViolation() { this._preferPredictionViolation = undefined; } // Temporarily expose input value. Use with caution. get preferPredictionViolationInput() { return this._preferPredictionViolation; } } exports.NrqlAlertConditionWarningPredictionOutputReference = NrqlAlertConditionWarningPredictionOutputReference; _h = JSII_RTTI_SYMBOL_1; NrqlAlertConditionWarningPredictionOutputReference[_h] = { fqn: "@cdktf/provider-newrelic.nrqlAlertCondition.NrqlAlertConditionWarningPredictionOutputReference", version: "12.28.0" }; function nrqlAlertConditionWarningToTerraform(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 { duration: cdktf.numberToTerraform(struct.duration), operator: cdktf.stringToTerraform(struct.operator), threshold: cdktf.numberToTerraform(struct.threshold), threshold_duration: cdktf.numberToTerraform(struct.thresholdDuration), threshold_occurrences: cdktf.stringToTerraform(struct.thresholdOccurrences), time_function: cdktf.stringToTerraform(struct.timeFunction), prediction: nrqlAlertConditionWarningPredictionToTerraform(struct.prediction), }; } function nrqlAlertConditionWarningToHclTerraform(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"); } const attrs = { duration: { value: cdktf.numberToHclTerraform(struct.duration), isBlock: false, type: "simple", storageClassType: "number", }, operator: { value: cdktf.stringToHclTerraform(struct.operator), isBlock: false, type: "simple", storageClassType: "string", }, threshold: { value: cdktf.numberToHclTerraform(struct.threshold), isBlock: false, type: "simple", storageClassType: "number", }, threshold_duration: { value: cdktf.numberToHclTerraform(struct.thresholdDuration), isBlock: false, type: "simple", storageClassType: "number", }, threshold_occurrences: { value: cdktf.stringToHclTerraform(struct.thresholdOccurrences), isBlock: false, type: "simple", storageClassType: "string", }, time_function: { value: cdktf.stringToHclTerraform(struct.timeFunction), isBlock: false, type: "simple", storageClassType: "string", }, prediction: { value: nrqlAlertConditionWarningPredictionToHclTerraform(struct.prediction), isBlock: true, type: "set", storageClassType: "NrqlAlertConditionWarningPredictionList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class NrqlAlertConditionWarningOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing */ constructor(terraformResource, terraformAttribute) { super(terraformResource, terraformAttribute, false, 0); this.isEmptyObject = false; // prediction - computed: false, optional: true, required: false this._prediction = new NrqlAlertConditionWarningPredictionOutputReference(this, "prediction"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._duration !== undefined) { hasAnyValues = true; internalValueResult.duration = this._duration; } if (this._operator !== undefined) { hasAnyValues = true; internalValueResult.operator = this._operator; } if (this._threshold !== undefined) { hasAnyValues = true; internalValueResult.threshold = this._threshold; } if (this._thresholdDuration !== undefined) { hasAnyValues = true; internalValueResult.thresholdDuration = this._thresholdDuration; } if (this._thresholdOccurrences !== undefined) { hasAnyValues = true; internalValueResult.thresholdOccurrences = this._thresholdOccurrences; } if (this._timeFunction !== undefined) { hasAnyValues = true; internalValueResult.timeFunction = this._timeFunction; } if (this._prediction?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.prediction = this._prediction?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._duration = undefined; this._operator = undefined; this._threshold = undefined; this._thresholdDuration = undefined; this._thresholdOccurrences = undefined; this._timeFunction = undefined; this._prediction.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._duration = value.duration; this._operator = value.operator; this._threshold = value.threshold; this._thresholdDuration = value.thresholdDuration; this._thresholdOccurrences = value.thresholdOccurrences; this._timeFunction = value.timeFunction; this._prediction.internalValue = value.prediction; } } get duration() { return this.getNumberAttribute('duration'); } set duration(value) { this._duration = value; } resetDuration() { this._duration = undefined; } // Temporarily expose input value. Use with caution. get durationInput() { return this._duration; } get operator() { return this.getStringAttribute('operator'); } set operator(value) { this._operator = value; } resetOperator() { this._operator = undefined; } // Temporarily expose input value. Use with caution. get operatorInput() { return this._operator; } get threshold() { return this.getNumberAttribute('threshold'); } set threshold(value) { this._threshold = value; } // Temporarily expose input value. Use with caution. get thresholdInput() { return this._threshold; } get thresholdDuration() { return this.getNumberAttribute('threshold_duration'); } set thresholdDuration(value) { this._thresholdDuration = value; } resetThresholdDuration() { this._thresholdDuration = undefined; } // Temporarily expose input value. Use with caution. get thresholdDurationInput() { return this._thresholdDuration; } get thresholdOccurrences() { return this.getStringAttribute('threshold_occurrences'); } set thresholdOccurrences(value) { this._thresholdOccurrences = value; } resetThresholdOccurrences() { this._thresholdOccurrences = undefined; } // Temporarily expose input value. Use with caution. get thresholdOccurrencesInput() { return this._thresholdOccurrences; } get timeFunction() { return this.getStringAttribute('time_function'); } set timeFunction(value) { this._timeFunction = value; } resetTimeFunction() { this._timeFunction = undefined; } // Temporarily expose input value. Use with caution. get timeFunctionInput() { return this._timeFunction; } get prediction() { return t