com.azure.resourcemanager.monitor.implementation.MetricAlertConditionImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-monitor Show documentation
Show all versions of azure-resourcemanager-monitor Show documentation
This package contains Microsoft Azure Monitor SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.resourcemanager.monitor.implementation;
import com.azure.resourcemanager.monitor.models.AggregationTypeEnum;
import com.azure.resourcemanager.monitor.models.MetricAlert;
import com.azure.resourcemanager.monitor.models.MetricAlertCondition;
import com.azure.resourcemanager.monitor.models.MetricAlertRuleCondition;
import com.azure.resourcemanager.monitor.models.MetricAlertRuleTimeAggregation;
import com.azure.resourcemanager.monitor.models.MetricCriteria;
import com.azure.resourcemanager.monitor.models.Operator;
import java.util.ArrayList;
/** Implementation for MetricAlertCondition. */
class MetricAlertConditionImpl extends MetricAlertConditionBaseImpl
implements MetricAlertCondition, MetricAlertCondition.DefinitionStages,
MetricAlertCondition.DefinitionStages.Blank.MetricName,
MetricAlertCondition.DefinitionStages.WithCriteriaOperator,
MetricAlertCondition.DefinitionStages.WithConditionAttach,
MetricAlertCondition.UpdateDefinitionStages,
MetricAlertCondition.UpdateDefinitionStages.Blank.MetricName,
MetricAlertCondition.UpdateDefinitionStages.WithCriteriaOperator,
MetricAlertCondition.UpdateDefinitionStages.WithConditionAttach,
MetricAlertCondition.UpdateStages {
MetricAlertConditionImpl(String name, MetricCriteria innerObject, MetricAlertImpl parent) {
super(name, innerObject, parent);
}
@Override
public MetricAlertConditionImpl withCondition(MetricAlertRuleTimeAggregation timeAggregation,
MetricAlertRuleCondition condition, double threshold) {
this.innerModel().withOperator(Operator.fromString(condition.toString()));
this.innerModel().withTimeAggregation(AggregationTypeEnum.fromString(timeAggregation.toString()));
this.innerModel().withThreshold(threshold);
return this;
}
@Override
public MetricAlertImpl attach() {
this.innerModel().withDimensions(new ArrayList<>(this.dimensions.values()));
return this.parent().withAlertCriteria(this);
}
@Override
public MetricAlertRuleCondition condition() {
return MetricAlertRuleCondition.fromString(this.innerModel().operator().toString());
}
@Override
public double threshold() {
return this.innerModel().threshold();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy