code: func (n *Notification) ShouldNotify(oldStatus, newStatus buildbucketpb.Status) bool {
  	switch {
  	case newStatus == buildbucketpb.Status_STATUS_UNSPECIFIED:
  		panic("new status must always be valid")
  	case n.OnSuccess && newStatus == buildbucketpb.Status_SUCCESS:
  	case n.OnFailure && newStatus == buildbucketpb.Status_FAILURE:
  	case n.OnChange && oldStatus != buildbucketpb.Status_STATUS_UNSPECIFIED && newStatus != oldStatus:
  	case n.OnNewFailure && newStatus == buildbucketpb.Status_FAILURE && oldStatus != buildbucketpb.Status_FAILURE:
  
  	default:
  		return false
  	}
  	return true
  }
docs: // ShouldNotify is the predicate function for whether a trigger's conditions have been met.