Class AlertPolicy.Condition.Builder

  • All Implemented Interfaces:
    AlertPolicy.ConditionOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    AlertPolicy.Condition

    public static final class AlertPolicy.Condition.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
    implements AlertPolicy.ConditionOrBuilder
     A condition is a true/false test that determines when an alerting policy
     should open an incident. If a condition evaluates to true, it signifies
     that something is wrong.
     
    Protobuf type google.monitoring.v3.AlertPolicy.Condition
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • clear

        public AlertPolicy.Condition.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • getDefaultInstanceForType

        public AlertPolicy.Condition getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public AlertPolicy.Condition build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public AlertPolicy.Condition buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public AlertPolicy.Condition.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • clearField

        public AlertPolicy.Condition.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • clearOneof

        public AlertPolicy.Condition.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • setRepeatedField

        public AlertPolicy.Condition.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                              int index,
                                                              Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • addRepeatedField

        public AlertPolicy.Condition.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                              Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • mergeFrom

        public AlertPolicy.Condition.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AlertPolicy.Condition.Builder>
        Throws:
        IOException
      • getName

        public String getName()
         Required if the condition exists. The unique resource name for this
         condition. Its format is:
        
             projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
        
         `[CONDITION_ID]` is assigned by Cloud Monitoring when the
         condition is created as part of a new or updated alerting policy.
        
         When calling the
         [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
         method, do not include the `name` field in the conditions of the
         requested alerting policy. Cloud Monitoring creates the
         condition identifiers and includes them in the new policy.
        
         When calling the
         [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
         method to update a policy, including a condition `name` causes the
         existing condition to be updated. Conditions without names are added to
         the updated policy. Existing conditions are deleted if they are not
         updated.
        
         Best practice is to preserve `[CONDITION_ID]` if you make only small
         changes, such as those to condition thresholds, durations, or trigger
         values.  Otherwise, treat the change as a new condition and let the
         existing condition be deleted.
         
        string name = 12;
        Specified by:
        getName in interface AlertPolicy.ConditionOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Required if the condition exists. The unique resource name for this
         condition. Its format is:
        
             projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
        
         `[CONDITION_ID]` is assigned by Cloud Monitoring when the
         condition is created as part of a new or updated alerting policy.
        
         When calling the
         [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
         method, do not include the `name` field in the conditions of the
         requested alerting policy. Cloud Monitoring creates the
         condition identifiers and includes them in the new policy.
        
         When calling the
         [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
         method to update a policy, including a condition `name` causes the
         existing condition to be updated. Conditions without names are added to
         the updated policy. Existing conditions are deleted if they are not
         updated.
        
         Best practice is to preserve `[CONDITION_ID]` if you make only small
         changes, such as those to condition thresholds, durations, or trigger
         values.  Otherwise, treat the change as a new condition and let the
         existing condition be deleted.
         
        string name = 12;
        Specified by:
        getNameBytes in interface AlertPolicy.ConditionOrBuilder
        Returns:
        The bytes for name.
      • setName

        public AlertPolicy.Condition.Builder setName​(String value)
         Required if the condition exists. The unique resource name for this
         condition. Its format is:
        
             projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
        
         `[CONDITION_ID]` is assigned by Cloud Monitoring when the
         condition is created as part of a new or updated alerting policy.
        
         When calling the
         [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
         method, do not include the `name` field in the conditions of the
         requested alerting policy. Cloud Monitoring creates the
         condition identifiers and includes them in the new policy.
        
         When calling the
         [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
         method to update a policy, including a condition `name` causes the
         existing condition to be updated. Conditions without names are added to
         the updated policy. Existing conditions are deleted if they are not
         updated.
        
         Best practice is to preserve `[CONDITION_ID]` if you make only small
         changes, such as those to condition thresholds, durations, or trigger
         values.  Otherwise, treat the change as a new condition and let the
         existing condition be deleted.
         
        string name = 12;
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public AlertPolicy.Condition.Builder clearName()
         Required if the condition exists. The unique resource name for this
         condition. Its format is:
        
             projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
        
         `[CONDITION_ID]` is assigned by Cloud Monitoring when the
         condition is created as part of a new or updated alerting policy.
        
         When calling the
         [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
         method, do not include the `name` field in the conditions of the
         requested alerting policy. Cloud Monitoring creates the
         condition identifiers and includes them in the new policy.
        
         When calling the
         [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
         method to update a policy, including a condition `name` causes the
         existing condition to be updated. Conditions without names are added to
         the updated policy. Existing conditions are deleted if they are not
         updated.
        
         Best practice is to preserve `[CONDITION_ID]` if you make only small
         changes, such as those to condition thresholds, durations, or trigger
         values.  Otherwise, treat the change as a new condition and let the
         existing condition be deleted.
         
        string name = 12;
        Returns:
        This builder for chaining.
      • setNameBytes

        public AlertPolicy.Condition.Builder setNameBytes​(com.google.protobuf.ByteString value)
         Required if the condition exists. The unique resource name for this
         condition. Its format is:
        
             projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
        
         `[CONDITION_ID]` is assigned by Cloud Monitoring when the
         condition is created as part of a new or updated alerting policy.
        
         When calling the
         [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
         method, do not include the `name` field in the conditions of the
         requested alerting policy. Cloud Monitoring creates the
         condition identifiers and includes them in the new policy.
        
         When calling the
         [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
         method to update a policy, including a condition `name` causes the
         existing condition to be updated. Conditions without names are added to
         the updated policy. Existing conditions are deleted if they are not
         updated.
        
         Best practice is to preserve `[CONDITION_ID]` if you make only small
         changes, such as those to condition thresholds, durations, or trigger
         values.  Otherwise, treat the change as a new condition and let the
         existing condition be deleted.
         
        string name = 12;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • getDisplayName

        public String getDisplayName()
         A short name or phrase used to identify the condition in dashboards,
         notifications, and incidents. To avoid confusion, don't use the same
         display name for multiple conditions in the same policy.
         
        string display_name = 6;
        Specified by:
        getDisplayName in interface AlertPolicy.ConditionOrBuilder
        Returns:
        The displayName.
      • getDisplayNameBytes

        public com.google.protobuf.ByteString getDisplayNameBytes()
         A short name or phrase used to identify the condition in dashboards,
         notifications, and incidents. To avoid confusion, don't use the same
         display name for multiple conditions in the same policy.
         
        string display_name = 6;
        Specified by:
        getDisplayNameBytes in interface AlertPolicy.ConditionOrBuilder
        Returns:
        The bytes for displayName.
      • setDisplayName

        public AlertPolicy.Condition.Builder setDisplayName​(String value)
         A short name or phrase used to identify the condition in dashboards,
         notifications, and incidents. To avoid confusion, don't use the same
         display name for multiple conditions in the same policy.
         
        string display_name = 6;
        Parameters:
        value - The displayName to set.
        Returns:
        This builder for chaining.
      • clearDisplayName

        public AlertPolicy.Condition.Builder clearDisplayName()
         A short name or phrase used to identify the condition in dashboards,
         notifications, and incidents. To avoid confusion, don't use the same
         display name for multiple conditions in the same policy.
         
        string display_name = 6;
        Returns:
        This builder for chaining.
      • setDisplayNameBytes

        public AlertPolicy.Condition.Builder setDisplayNameBytes​(com.google.protobuf.ByteString value)
         A short name or phrase used to identify the condition in dashboards,
         notifications, and incidents. To avoid confusion, don't use the same
         display name for multiple conditions in the same policy.
         
        string display_name = 6;
        Parameters:
        value - The bytes for displayName to set.
        Returns:
        This builder for chaining.
      • hasConditionThreshold

        public boolean hasConditionThreshold()
         A condition that compares a time series against a threshold.
         
        .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;
        Specified by:
        hasConditionThreshold in interface AlertPolicy.ConditionOrBuilder
        Returns:
        Whether the conditionThreshold field is set.
      • clearConditionThreshold

        public AlertPolicy.Condition.Builder clearConditionThreshold()
         A condition that compares a time series against a threshold.
         
        .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;
      • getConditionThresholdBuilder

        public AlertPolicy.Condition.MetricThreshold.Builder getConditionThresholdBuilder()
         A condition that compares a time series against a threshold.
         
        .google.monitoring.v3.AlertPolicy.Condition.MetricThreshold condition_threshold = 1;
      • hasConditionAbsent

        public boolean hasConditionAbsent()
         A condition that checks that a time series continues to
         receive new data points.
         
        .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;
        Specified by:
        hasConditionAbsent in interface AlertPolicy.ConditionOrBuilder
        Returns:
        Whether the conditionAbsent field is set.
      • clearConditionAbsent

        public AlertPolicy.Condition.Builder clearConditionAbsent()
         A condition that checks that a time series continues to
         receive new data points.
         
        .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;
      • getConditionAbsentBuilder

        public AlertPolicy.Condition.MetricAbsence.Builder getConditionAbsentBuilder()
         A condition that checks that a time series continues to
         receive new data points.
         
        .google.monitoring.v3.AlertPolicy.Condition.MetricAbsence condition_absent = 2;
      • hasConditionMatchedLog

        public boolean hasConditionMatchedLog()
         A condition that checks for log messages matching given constraints. If
         set, no other conditions can be present.
         
        .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;
        Specified by:
        hasConditionMatchedLog in interface AlertPolicy.ConditionOrBuilder
        Returns:
        Whether the conditionMatchedLog field is set.
      • setConditionMatchedLog

        public AlertPolicy.Condition.Builder setConditionMatchedLog​(AlertPolicy.Condition.LogMatch value)
         A condition that checks for log messages matching given constraints. If
         set, no other conditions can be present.
         
        .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;
      • setConditionMatchedLog

        public AlertPolicy.Condition.Builder setConditionMatchedLog​(AlertPolicy.Condition.LogMatch.Builder builderForValue)
         A condition that checks for log messages matching given constraints. If
         set, no other conditions can be present.
         
        .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;
      • mergeConditionMatchedLog

        public AlertPolicy.Condition.Builder mergeConditionMatchedLog​(AlertPolicy.Condition.LogMatch value)
         A condition that checks for log messages matching given constraints. If
         set, no other conditions can be present.
         
        .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;
      • clearConditionMatchedLog

        public AlertPolicy.Condition.Builder clearConditionMatchedLog()
         A condition that checks for log messages matching given constraints. If
         set, no other conditions can be present.
         
        .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;
      • getConditionMatchedLogBuilder

        public AlertPolicy.Condition.LogMatch.Builder getConditionMatchedLogBuilder()
         A condition that checks for log messages matching given constraints. If
         set, no other conditions can be present.
         
        .google.monitoring.v3.AlertPolicy.Condition.LogMatch condition_matched_log = 20;
      • hasConditionMonitoringQueryLanguage

        public boolean hasConditionMonitoringQueryLanguage()
         A condition that uses the Monitoring Query Language to define
         alerts.
         
        .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;
        Specified by:
        hasConditionMonitoringQueryLanguage in interface AlertPolicy.ConditionOrBuilder
        Returns:
        Whether the conditionMonitoringQueryLanguage field is set.
      • clearConditionMonitoringQueryLanguage

        public AlertPolicy.Condition.Builder clearConditionMonitoringQueryLanguage()
         A condition that uses the Monitoring Query Language to define
         alerts.
         
        .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;
      • getConditionMonitoringQueryLanguageBuilder

        public AlertPolicy.Condition.MonitoringQueryLanguageCondition.Builder getConditionMonitoringQueryLanguageBuilder()
         A condition that uses the Monitoring Query Language to define
         alerts.
         
        .google.monitoring.v3.AlertPolicy.Condition.MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;
      • hasConditionPrometheusQueryLanguage

        public boolean hasConditionPrometheusQueryLanguage()
         A condition that uses the Prometheus query language to define alerts.
         
        .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;
        Specified by:
        hasConditionPrometheusQueryLanguage in interface AlertPolicy.ConditionOrBuilder
        Returns:
        Whether the conditionPrometheusQueryLanguage field is set.
      • clearConditionPrometheusQueryLanguage

        public AlertPolicy.Condition.Builder clearConditionPrometheusQueryLanguage()
         A condition that uses the Prometheus query language to define alerts.
         
        .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;
      • getConditionPrometheusQueryLanguageBuilder

        public AlertPolicy.Condition.PrometheusQueryLanguageCondition.Builder getConditionPrometheusQueryLanguageBuilder()
         A condition that uses the Prometheus query language to define alerts.
         
        .google.monitoring.v3.AlertPolicy.Condition.PrometheusQueryLanguageCondition condition_prometheus_query_language = 21;
      • setUnknownFields

        public final AlertPolicy.Condition.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>
      • mergeUnknownFields

        public final AlertPolicy.Condition.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AlertPolicy.Condition.Builder>