Class Snooze.Criteria.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Snooze.Criteria.Builder>
com.google.monitoring.v3.Snooze.Criteria.Builder
All Implemented Interfaces:
Snooze.CriteriaOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Snooze.Criteria

public static final class Snooze.Criteria.Builder extends com.google.protobuf.GeneratedMessage.Builder<Snooze.Criteria.Builder> implements Snooze.CriteriaOrBuilder
 Criteria specific to the `AlertPolicy`s that this `Snooze` applies to. The
 `Snooze` will suppress alerts that come from one of the `AlertPolicy`s
 whose names are supplied.
 
Protobuf type google.monitoring.v3.Snooze.Criteria
  • Method Summary

    Modifier and Type
    Method
    Description
    The specific `AlertPolicy` names for the alert that should be snoozed.
    The specific `AlertPolicy` names for the alert that should be snoozed.
    addPoliciesBytes(com.google.protobuf.ByteString value)
    The specific `AlertPolicy` names for the alert that should be snoozed.
     
     
     
    Optional.
    The specific `AlertPolicy` names for the alert that should be snoozed.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    Optional.
    com.google.protobuf.ByteString
    Optional.
    getPolicies(int index)
    The specific `AlertPolicy` names for the alert that should be snoozed.
    com.google.protobuf.ByteString
    getPoliciesBytes(int index)
    The specific `AlertPolicy` names for the alert that should be snoozed.
    int
    The specific `AlertPolicy` names for the alert that should be snoozed.
    com.google.protobuf.ProtocolStringList
    The specific `AlertPolicy` names for the alert that should be snoozed.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    Optional.
    setFilterBytes(com.google.protobuf.ByteString value)
    Optional.
    setPolicies(int index, String value)
    The specific `AlertPolicy` names for the alert that should be snoozed.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Snooze.Criteria.Builder>
    • clear

      public Snooze.Criteria.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.GeneratedMessage.Builder<Snooze.Criteria.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.GeneratedMessage.Builder<Snooze.Criteria.Builder>
    • getDefaultInstanceForType

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

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

      public Snooze.Criteria buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Snooze.Criteria.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Snooze.Criteria.Builder>
    • mergeFrom

      public Snooze.Criteria.Builder mergeFrom(Snooze.Criteria other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Snooze.Criteria.Builder>
    • mergeFrom

      public Snooze.Criteria.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<Snooze.Criteria.Builder>
      Throws:
      IOException
    • getPoliciesList

      public com.google.protobuf.ProtocolStringList getPoliciesList()
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Specified by:
      getPoliciesList in interface Snooze.CriteriaOrBuilder
      Returns:
      A list containing the policies.
    • getPoliciesCount

      public int getPoliciesCount()
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Specified by:
      getPoliciesCount in interface Snooze.CriteriaOrBuilder
      Returns:
      The count of policies.
    • getPolicies

      public String getPolicies(int index)
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Specified by:
      getPolicies in interface Snooze.CriteriaOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The policies at the given index.
    • getPoliciesBytes

      public com.google.protobuf.ByteString getPoliciesBytes(int index)
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Specified by:
      getPoliciesBytes in interface Snooze.CriteriaOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the policies at the given index.
    • setPolicies

      public Snooze.Criteria.Builder setPolicies(int index, String value)
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Parameters:
      index - The index to set the value at.
      value - The policies to set.
      Returns:
      This builder for chaining.
    • addPolicies

      public Snooze.Criteria.Builder addPolicies(String value)
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Parameters:
      value - The policies to add.
      Returns:
      This builder for chaining.
    • addAllPolicies

      public Snooze.Criteria.Builder addAllPolicies(Iterable<String> values)
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Parameters:
      values - The policies to add.
      Returns:
      This builder for chaining.
    • clearPolicies

      public Snooze.Criteria.Builder clearPolicies()
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Returns:
      This builder for chaining.
    • addPoliciesBytes

      public Snooze.Criteria.Builder addPoliciesBytes(com.google.protobuf.ByteString value)
       The specific `AlertPolicy` names for the alert that should be snoozed.
       The format is:
      
       projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]
      
       There is a limit of 16 policies per snooze. This limit is checked during
       snooze creation.
       Exactly 1 alert policy is required if `filter` is specified at the same
       time.
       
      repeated string policies = 1 [(.google.api.resource_reference) = { ... }
      Parameters:
      value - The bytes of the policies to add.
      Returns:
      This builder for chaining.
    • getFilter

      public String getFilter()
       Optional. The filter string to match on Alert fields when silencing the
       alerts. It follows the standard https://google.aip.dev/160 syntax.
       A filter string used to apply the snooze to specific incidents
       that have matching filter values.
       Filters can be defined for snoozes that apply to one alerting
       policy.
       Filters must be a string formatted as one or more resource labels with
       specific label values. If multiple resource labels are used, then they
       must be connected with an AND operator. For example, the following filter
       applies the snooze to incidents that have an instance ID of
       `1234567890` and a zone of `us-central1-a`:
      
       resource.labels.instance_id="1234567890" AND
       resource.labels.zone="us-central1-a"
       
      string filter = 2;
      Specified by:
      getFilter in interface Snooze.CriteriaOrBuilder
      Returns:
      The filter.
    • getFilterBytes

      public com.google.protobuf.ByteString getFilterBytes()
       Optional. The filter string to match on Alert fields when silencing the
       alerts. It follows the standard https://google.aip.dev/160 syntax.
       A filter string used to apply the snooze to specific incidents
       that have matching filter values.
       Filters can be defined for snoozes that apply to one alerting
       policy.
       Filters must be a string formatted as one or more resource labels with
       specific label values. If multiple resource labels are used, then they
       must be connected with an AND operator. For example, the following filter
       applies the snooze to incidents that have an instance ID of
       `1234567890` and a zone of `us-central1-a`:
      
       resource.labels.instance_id="1234567890" AND
       resource.labels.zone="us-central1-a"
       
      string filter = 2;
      Specified by:
      getFilterBytes in interface Snooze.CriteriaOrBuilder
      Returns:
      The bytes for filter.
    • setFilter

      public Snooze.Criteria.Builder setFilter(String value)
       Optional. The filter string to match on Alert fields when silencing the
       alerts. It follows the standard https://google.aip.dev/160 syntax.
       A filter string used to apply the snooze to specific incidents
       that have matching filter values.
       Filters can be defined for snoozes that apply to one alerting
       policy.
       Filters must be a string formatted as one or more resource labels with
       specific label values. If multiple resource labels are used, then they
       must be connected with an AND operator. For example, the following filter
       applies the snooze to incidents that have an instance ID of
       `1234567890` and a zone of `us-central1-a`:
      
       resource.labels.instance_id="1234567890" AND
       resource.labels.zone="us-central1-a"
       
      string filter = 2;
      Parameters:
      value - The filter to set.
      Returns:
      This builder for chaining.
    • clearFilter

      public Snooze.Criteria.Builder clearFilter()
       Optional. The filter string to match on Alert fields when silencing the
       alerts. It follows the standard https://google.aip.dev/160 syntax.
       A filter string used to apply the snooze to specific incidents
       that have matching filter values.
       Filters can be defined for snoozes that apply to one alerting
       policy.
       Filters must be a string formatted as one or more resource labels with
       specific label values. If multiple resource labels are used, then they
       must be connected with an AND operator. For example, the following filter
       applies the snooze to incidents that have an instance ID of
       `1234567890` and a zone of `us-central1-a`:
      
       resource.labels.instance_id="1234567890" AND
       resource.labels.zone="us-central1-a"
       
      string filter = 2;
      Returns:
      This builder for chaining.
    • setFilterBytes

      public Snooze.Criteria.Builder setFilterBytes(com.google.protobuf.ByteString value)
       Optional. The filter string to match on Alert fields when silencing the
       alerts. It follows the standard https://google.aip.dev/160 syntax.
       A filter string used to apply the snooze to specific incidents
       that have matching filter values.
       Filters can be defined for snoozes that apply to one alerting
       policy.
       Filters must be a string formatted as one or more resource labels with
       specific label values. If multiple resource labels are used, then they
       must be connected with an AND operator. For example, the following filter
       applies the snooze to incidents that have an instance ID of
       `1234567890` and a zone of `us-central1-a`:
      
       resource.labels.instance_id="1234567890" AND
       resource.labels.zone="us-central1-a"
       
      string filter = 2;
      Parameters:
      value - The bytes for filter to set.
      Returns:
      This builder for chaining.